SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot Junk's Avatar
    Join Date
    Dec 2004
    Location
    Asia
    Posts
    193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink Pop up menu and stop execution upon detection of blank field

    Hi,

    need some advise here.

    There will be a pop up menu upon detection of a blank field and I need to stop further execution of the script. How do I achieve that?

    <?php if ($email_to == ' ' )?>
    <script language="JavaScript" type="text/javascript">
    window.alert("Please enter your the to field. Thank you.");
    </script>

    Thanks and happy new year!
    Regards,
    Junk

    I am never more keen to learn...

  2. #2
    &#083;itePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <form action="form_process.php" method="post" onsubmit="return yourFunction();"></form>

    The onsubmit calls your function before actually submitting the form. If the function, upon completion, returns a Boolean "true", the submit will proceed. If it returns "false" the submit will be cancelled.


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
  •