xpace Posted August 5, 2009 Share Posted August 5, 2009 I have an onchange function in my PHP form that sends a value via GET and then shows it in a DIV named extra. form method is POST btw <select name='business_type_main' onchange=\"$('#extra').load('?trade='+this.value);\"> it shows up checkboxes selected by the value of /trade/ without reloading the page. then I just select any number of checkboxes and press NEXT, which is a SUBMIT button (of course there are other fields to fill up). after pressing the SUBMIT (NEXT) button it will call a PHP function to check all required fields and if there are some missing or incorrect, it will show up the same form with already inserted values and warning messages. here comes the big problem : I need to show the checkboxes again with the originally ticked boxes and have the /trade/ variable value ready again for following SUBMITs so everytime the client makes a mistake it will show all the fields with values already inserted including the checkboxes. I hope it is clear enough to understand my problem. thanks very much Quote Link to comment https://forums.phpfreaks.com/topic/168905-noob-noob-noob/ Share on other sites More sharing options...
JonnoTheDev Posted August 5, 2009 Share Posted August 5, 2009 use an onload event to restore the boxes from the ajax script. use a page parameter to trigger it. you may need to write another js function that handles this. Quote Link to comment https://forums.phpfreaks.com/topic/168905-noob-noob-noob/#findComment-891219 Share on other sites More sharing options...
xpace Posted August 5, 2009 Author Share Posted August 5, 2009 thanks mate for the suggestion. as I have no idea how this works I would really need someone to show me the script as the script I have is also from some ajax guru thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/168905-noob-noob-noob/#findComment-891333 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.