watagal Posted May 14, 2006 Share Posted May 14, 2006 GreetingsWhen a user clicks the "reset" button on a form -- it restores the form elements back to their oringinal values. Yet as usual, I want it to do more - like toggle a <div> display.How can I write a wrapper or tap into the "Reset" button to do more than it's original function?TIA Link to comment Share on other sites More sharing options...
skym Posted May 14, 2006 Share Posted May 14, 2006 http://www.w3schools.com/htmldom/dom_obj_form.aspTry the onReset event. Some thing like<form action="..." onreset="yourfunction()"> Link to comment Share on other sites More sharing options...
scott100 Posted May 14, 2006 Share Posted May 14, 2006 Here you go, i've used <form onreset=""> to call a function to show the div. <head><script>function resetForm(){document.getElementById('mydiv').style.display="block";}</script></head><body><form onreset="resetForm()"><p>name: <input type="text"><br />address: <input type="text"></p><div id="mydiv" style="display:none">Hi, you just pressed reset </div><p><input type="submit" value="submit" /><input type="reset" value="reset" /></p><form></body> Link to comment Share on other sites More sharing options...
watagal Posted May 14, 2006 Author Share Posted May 14, 2006 Thanks all, that's what I was looking for.Playing around with it more I found <input type="reset" value="Reset" name="btnReset" onclick="dspDiv('divTest','off')"> also works, but I like the 'onreset' event.TA Link to comment Share on other sites More sharing options...
virtualadz Posted June 19, 2006 Share Posted June 19, 2006 does anyone know if i can add the id=myForm to this<?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_WHOLESALE, 'action=send')); ?> Link to comment Share on other sites More sharing options...
skym Posted June 20, 2006 Share Posted June 20, 2006 The modification you will have to make is within the function, please post the function and not only the line which is calling it. But not here, make a new topic in the PHP forum. Link to comment Share on other sites More sharing options...
virtualadz Posted June 20, 2006 Share Posted June 20, 2006 http://w3schools.invisionzone.com/index.php?showtopic=5356 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now