SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    tryinng to understand this code?

    hi,

    I am not a javascript expert, most of the time when i had to do call a javascript function I used to do it like this, and in my javascript function I will have form.submit() if it passes the validatiion



    <form action='index' method="post" id='form1' name='form1' onsubmit="callSubmitfunctions('submit', 'images/button_process.gif'); ">


    Now I see this code where they have put "return" like the following, why return and what does it do?

    <form action='index' method="post" id='form1' name='form1' onsubmit=" return callSubmitfunctions('submit', 'images/button_process.gif'); ">

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What that means is:
    If the function returns true, submit the form.
    If the function returns false, don't submit.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks


Bookmarks

Posting Permissions

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