Filling information back to form

NoriGashi

New Member
Was wondering if anyone can help me out with this coding. How could I fill back information after the user has clicked submit using Javascript.\[code\]<?$the_pump = $_POST['action1'];if($the_pump == "xxx"){ var_dump($_POST['textVal']); var_dump($_POST['numDep']);}?><form style="padding: 0px; margin: 0px" id="evaluation-form" method="post" action=""><table><tr><td>No of Dependent</td><td><select name="numDep" id="dropdown1"> <option value="">Please Select</option> <option value="http://stackoverflow.com/questions/15751390/0">0</option> <option value="http://stackoverflow.com/questions/15751390/1">1</option> <option value="http://stackoverflow.com/questions/15751390/2">2</option> </select></td></tr><tr id="textboxDiv"></tr></table><script type="text/javascript">$(document).ready(function() { $("#dropdown1").change(function() { var selVal = $(this).val(); $("#textboxDiv").html(''); if(selVal > 0) { for(var i = 1; i<= selVal; i++) { $("#textboxDiv").append('<input type="text" name="textVal[]" value="" />'); } } });});</script><input type="hidden" name="action1" value="http://stackoverflow.com/questions/15751390/xxx"><input id="register-button" name="pass_method" type="submit" value="http://stackoverflow.com/questions/15751390/Save"></div></form>\[/code\]So this basically asked the user how many textbox to appears and after the user has selected it will display the amount of textbox. The problem I am having is right now is when the page is reloaded it does not populate back the information in the textbox and everything disappears making users not sure if they have submitted the information.
 
Back
Top