Save the form in PHP Restore the form We use PHP variables to do it optionally (they are only setup if the form setup is to be restored) N.B. This code is only handling checkboxes and select boxes currently PHP HTML
Category: Forms
Select Box
Causing Form To Submit OnChange Call function when selection changed Which item is selected? Show / Hide page elements depending on Select box item chosen PHP Javascript
Auto Submit A Form
Very simple method Auto submit from javascript Auto submit from paste or key up
Buttons that do things
Pass text box value to javascript function when a button is pressed <script language="javascript"> //—– PLAY —– function vlc_play(uri1) { vlc_player1.play(uri1); } </script> <input id='uri' value='http://www.some_domain.com/duck.mp4' size=70 type='text'><button onclick="vlc_play($('#uri').val())">Play</button>
Submit form
document.getElementById(‘uploaded_dest_file_name’).value=”[var.upload_filename]”; document.forms[“form_upload_complete”].submit();
Adding a variable to a form
Create the form <form id=”my_form_name” name=”my_form_name” method=”post” action=”http://www.mydomain.com/destination_page.php”> <input type=”hidden” name=”form_parameter1″ id=”form_parameter1″ value=”” /> <!– etc… –> </form> Create the variable <script type=”text/javascript”> var parameter1 = ‘TEST’; </script> To load the form field with the varaible document.getElementById(‘form_parameter1’).value=parameter1; //If you want to auto submit the form document.forms[“my_form_name”].submit();