Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
  1. #1
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    How to code the onMouseClick event for action within a Selection box?

    I have a lengthy selection box and the value of the selection is the ID string that I need. When the box is selected, I want to fill in some textboxes based on the value of the ID.

    I guess I'll have to call the page again and fill the boxes thru code, but I still don't know how to do the mouse event.

    I need a code snippet, and I can't find it.
    DerFarm
    I talk to squirrels.
    Squirrels Answer.

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Code:
    <select onChange="alert('boo!')">
    <option...>
    </select>
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    I can't seem to make it work.

    Code:
    <SELECT style="Z-INDEX: 103; & chr(34) WIDTH: 75%; 
        FONT-FAMILY: 'Courier New';"size="25" 
        Name=PatList onChange="PatID=patlist">
    What I want is for the value of patlist to be available to the next page in the sequence. By using onChange="alert('ddd')" ddd DOES show up in a cute little box (actually, I'm going to use that elsewhere, thank you).

    But it doesn't place the value of the selection in PatID.

    What am I doing wrong?????. I would also like to to perform an action along with this. Kinda like onChange="<A HREF=dkjfkdjfdkjdkjfkj..."

    BTW, I tried the above and got nothing.
    DerFarm
    I talk to squirrels.
    Squirrels Answer.

  5. #4
    Senior Member energizze's Avatar
    Join Date
    Oct 2002
    Posts
    260
    Member #
    238
    Code:
    <form name="selc">
    <SELECT style="Z-INDEX: 103; & chr(34) WIDTH: 75%; 
        FONT-FAMILY: 'Courier New';"size="25" 
        Name=PatList onChange="var PatID = document.selc.PatList.selectedIndex;">
    </form>

    does that work.

  6. #5
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    FWIW you can use this.selectedIndex instead of document.selc.PatList.selectedIndex.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  7. #6
    Senior Member energizze's Avatar
    Join Date
    Oct 2002
    Posts
    260
    Member #
    238
    yeah, i forgot about that.

    it's midnight for me tho, i'm tired. :sleeping:

  8. #7
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    Most Excellent. I'm too freaked right now to think straight, I should've realized it was something like that.

    Thanx all

    I owe you one, Arien
    DerFarm
    I talk to squirrels.
    Squirrels Answer.

  9. #8
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    ok, Here we go again,
    Code:
    <form name='selc' method="Post" action="CCPD_PatientMainMenu.asp?PID=>>>...>"
    passes >>>... on to the next page (CCPD_....)


    Code:
    <form name='selc' method="Post" action="CCPD_PatientMainMenu.asp?PID=>>>" & document.selc.PatList.selected & "...>"
    passes >>> (note that the ... is missing)

    Code:
    <form name='selc' method="Post" action="CCPD_PatientMainMenu.asp?PID=>>>" & document.selc.PatList.SelectedIndex & "...>"
    passes >>> (once again, not the ... is missing)

    What am I doing wrong?
    DerFarm
    I talk to squirrels.
    Squirrels Answer.

  10. #9
    Senior Member energizze's Avatar
    Join Date
    Oct 2002
    Posts
    260
    Member #
    238
    if all you're trying to do is parse the value of the select box to an ASP script then y not just use this:


    Code:
    <form name='selc' method='get' action='CCPD_PatientMainMenu.asp'>
    <select name='PID' onchange='document.selc.submit()'>
    <option value='0'> Option1
    <option value='1'> Option2
    <option value='2'> Option3
    <option value='3'> Option4
    </select>
    </form>

  11. #10
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    It didn't work.

    Code:
    onchange='document.selc.submit()'
    gives me the error: Object doesn't support this property or method: document.selc.submit()

    neither did document.submit(), document.submit

    What's driving me crazy is that the stupid alert works. WHY CAN'T I GET THE DAMN ID NUMBER ON THIS PAGE???????
    DerFarm
    I talk to squirrels.
    Squirrels Answer.


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:52 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com