View Full Version : If submit button is clicked then do this

01-28-2005, 04:28 PM
okay i have a page that has an iframe in it with a name of frame1, this iframe has a simple email form, this button has an id of "process", i am wondering if there is some kind of javascript that will check to see if the submit button is clicked or the enter key is used in the form, and if it is used, then an action happens on the parent page i've tried something like this

<script type="text/javascript">
function checkclick(){
function scrolling(){
i would then use the body onload to call checkclick()
the script is in the parent window, and for certain reasons i prefer not to change any of the code in the iframe, is this possible?

01-28-2005, 04:51 PM
.............. I removed the answer, it was a iframe located solution

Willy Duitt
01-28-2005, 04:52 PM
I believe if the submit button has a name or id and a value... when it is clicked the name and value is sent with the form contents while if the enter button is pressed, this information is not... Therefore, check if the submit buttons name/value pair is present upon form submittal...