SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Popup Massage

Hybrid View

  1. #1
    SitePoint Enthusiast Nasser's Avatar
    Join Date
    Jul 2001
    Location
    Qatar
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Popup Massage

    Hello All
    I have ASP survey page that has pulldown menu and submit button .
    I wnat to stop user if he/she didn't select one option form the pulldown menu .User should get a popup Massage e.g.( in order to submit your results you must choose one form the above menu )
    How can I do this?

  2. #2
    SitePoint Zealot easyrew's Avatar
    Join Date
    Nov 2001
    Location
    Milton Keynes, UK
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aw - I got all excited by the Thread title...but this isn't what I was expecting. I thought it would be something I could add to my site to increase traffic

    Rich
    If a man stands alone in the forest
    and there's no woman around to hear him,
    is he still wrong?
    w: www.EasyRew.com

  3. #3
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    a massage? nope, i'm afraid that can't be done...
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  4. #4
    SitePoint Addict Viral's Avatar
    Join Date
    Nov 2001
    Location
    Washington DC
    Posts
    294
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript is your friend

    As these guys pointed out - a popup massage? As in a nice back rub? no...

    A popup message, though, is pretty easy

    What you want to do is validate the form. The easiest way to do that is with javascript...

    PHP Code:
    <script language="JavaScript">
    function 
    validate() {
       if (
    document.theform.pulldown.selectedIndex == 0) {
           
    alert ("You must choose from the pulldown"); }
       return 
    false;

    Then call your JS function in the form:

    PHP Code:
    <form name="theform" action="whatever" onSubmit="validate()"
    --Viral
    A computer without Windows is like a chocolate cake without mustard.

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2001
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Javascript is your friend

    Originally posted by Viral
    As these guys pointed out - a popup massage? As in a nice back rub? no...

    A popup message, though, is pretty easy

    What you want to do is validate the form. The easiest way to do that is with javascript...

    PHP Code:
    <script language="JavaScript">
    function 
    validate() {
       if (
    document.theform.pulldown.selectedIndex == 0) {
           
    alert ("You must choose from the pulldown"); }
       return 
    false;

    Then call your JS function in the form:

    PHP Code:
    <form name="theform" action="whatever" onSubmit="validate()"
    --Viral
    You forgot to put </script> in the lastest line of JavaScript.

  6. #6
    SitePoint Addict Viral's Avatar
    Join Date
    Nov 2001
    Location
    Washington DC
    Posts
    294
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually, I did put it, but the QUOTE tag strips it out...? I tried several ways to get it in there, but it wouldn't print out

    --Viral
    A computer without Windows is like a chocolate cake without mustard.

  7. #7
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <script language="JavaScript">
    function validate() {
       if (document.theform.pulldown.selectedIndex == 0) {
           alert ("You must choose from the pulldown"); }
       return false;
    }
    </script>
    Put it in code tags

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


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
  •