In my application I will eventually want to dynamically assign values to certain checkbox values but where I am at currently is this.
When the page first loads, a set of checkboxes load and when any of these are checked, a corresponding div is revealed nearby. In THAT div there is an additional checkbox that drops down a section of text that should match what the value of the original checkbox value is.
I have the click a box, reveal a box, click a box, reveal the text part working correctly but what it displays is hardcoded and I'm trying to figure out how to pass the values of the checkboxes around to tie everything together dynamically. Thank you for your assistance on this.
Related
I have a website which has 3 select boxes at the top. These select boxes are used as filters for a table I am displaying underneath it. When you change something on the select box I filter the table.
If I change the select box values and go to a new page and hit the back arrow at the top and return to the same page all of my select boxes changes are still there. However, the filter that I applied to the tables using javascript does not match the filter displayed. The table displays data for the default filters.
I though if I just run the filter function on page load, things would work again. But turns out the filter function runs way before chrome resets the value of the select boxes from the cache. When I set the breakpoint and started debugging the progression on returning back to page is:
1. The select boxes resets to default values (i.e the order of the `<option>` tag)
2. The table filters based on the default values
3. Chrome at some point decides to readd the filter
How do you guys deal with this?
I have written a JavaScript function that shows a text input field when a checkbox is clicked. The essence of the function is basically to change the text box display property from "none", to "block" on checkbox click. This works fine, and thus when I check the box I see the text field, and when I uncheck the box, the text box hides.
Now, I am trying to figure out how to keep the text box showing after the page is refreshed. This is where I am stuck.
Any suggestions? Thanks!
Please let me know if I need to clarify anything!
Best way is to store your state in a cookie and read it after load to get back to the same state : Set cookie and get cookie with JavaScript
I'm having this issue where I have a table that depending on what option I select for the first column, the next column which contains a drop down, will populate with the appropriate values that users can select.
Here's an example
When the user submits the form, they're brought to a results page and have the option of going back to the first screen (where they select the drop downs etc).
Currently, I'm using the window.history.go() function to go back to the previous pages. However, the dynamically created drop downs aren't retaining the value that the user selects (the option that is at the very top of the drop down is always selected).
I'm currently using PHP for the scripts to generate the tables. Is there a way to fix this? Just need someone to point me in the right direction.
Thank you!
u can use history.pushstate(url+'#idx=x') when dropdown changes. and load the param values into dropdown when page loaded
I have a Web page(aspx) with a large amount of JavaScript and Jquery(Used for managing the image scrolling for different sections like Featured products,Special Offers etc)
In the Featured Products section multiple product details are listed .
Each product has an associated text box where the user can enter a quantity that he wants to purchase.
When I try to get the value of a particular text box using JavaScript I get the default value of the text box instead of the value that is currently entered in the text box.
Using J Query also results in the default value being returned.
If the text box is moved to the beginning of the form section the currently entered value in the text box is returned as expected.
Thanks in advance for any tips as to why this is happening
Regards
Mathew
Could not find the actual problem. Anyway I am able to access the value that is entered in the textbox using Jquery.
Later I realised that the problem was occuring because the textbox was included in a slideshow
generated using Jquery Cycle2 plugin
I am trying this one to solve since last night but could not hence asking for help.
There are two pages, such as name.jsp and roll.jsp. In name.jsp there are two input text boxes and one checkbox.I entered data in two text boxes and i checked the check box , when i checked the check box i am going to roll.jsp and in roll.jsp 2 text boxes are present.
When I reached roll.jsp by clicking checkbox, I kept the link(name.jsp) on roll.jsp page and when i am clicking name.jsp I am not able to see my previously entered data on two textboxes. How can i achieve this? I am going to roll.jsp through a checkbox and i want to see all my previously entered data on name.jsp when i am clicking name.jsp hyperlink which is present in roll.jsp. How to achieve it? Two different forms are in these two pages.
Any help is much appreciated
When you have navigated away from page, all its input data will be lost. To remain it, you have to carry the data over either by request or through saving the data in a database/localstorage.
OR
You can try to use an iframe/SPA kind of behaviour. Where roll.jsp is loaded within the name.jsp either by iframe or using AJAX to bring in the content. That way you would not have navigated away from the page and thus the input data can still be used.
On event of click, if that checkbox is checked, make a call for roll.jsp, which will submit the value of current 2 textbox as well as it will show in roll.jsp.
For showing the previously entered values, accept using request.getParameter(string) and print that in roll.jsp.
Whatever the response will come from roll.jsp, print that is one div.
Hope your problem is solved.