Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts

    If submit button is clicked then do this

    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
    Code:
    <script type="text/javascript">
    function checkclick(){
    if(frame1.document.getElementById('process')){
    frame1.document.getElementById('process').onclick=scrolling;
    }
    }
    function scrolling(){
    parent.window.scrollTo(0,0);
    }
    </script>
    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?

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    .............. I removed the answer, it was a iframe located solution
    Last edited by Kor; 01-28-2005 at 03:54 PM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...

    .....Willy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •