#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2012
    Posts
    6
    Rep Power
    0

    getting value from select/option?


    I'm getting back into coding after a long absence from it. In classic ASP how would I print out/display the two letter state code in a standard select/list:

    <select name="regstater" size="0" id="regstate">
    <option value="AL">Alabama</option>
    ....
    </select><%=regstater.value%>

    doesn't work. What should I be doing, instead?
  2. #2
  3. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,665
    Rep Power
    284
    from request just <%=request("regstater")%>
    Is that what you need?

    Comments on this post

    • Will-O-The-Wisp agrees : Thank you!
    GK
    __________________________________________________ _____
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree
  4. #3
  5. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2012
    Posts
    6
    Rep Power
    0
    > ]from request just <%=request("regstater")%> Is that what you need?

    Yeah, that'll work! I was overthinking this!

    Thank you.

    (I wanted to give you a "kodo" for a good answer for the "Give Rep" mentioned in the post could not be found?)
  6. #4
  7. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2012
    Posts
    6
    Rep Power
    0
    okay. given this:

    inside a form's input textfield
    :<select size="0" id="regstater" onclick= "NHState.value = regstater.value" >
    <option value="AL">Alabama</option....etc.
    </select>

    how can I have the .value replace the <select></select> upon click?
  8. #5
  9. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2012
    Posts
    6
    Rep Power
    0
    (Here's an example of what is *not* working -- Nursing Home Registration)
  10. #6
  11. Guru
    ASP Adventurer (500 - 999 posts)

    Join Date
    May 2003
    Location
    USA
    Posts
    923
    Rep Power
    79
    When clicking your link I saw this:
    <<
    Microsoft JET Database Engine error '80040e37'

    The Microsoft Jet database engine cannot find the input table or query 'Nursing Home'. Make sure it exists and that its name is spelled correctly.

    /teststate.asp, line 87
    >>

    Well in general it is not a good idea to have table names with spaces in them so NursingHome would be a much better name than Nursing Home. And this is true for fields too.
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

Similar Threads

  1. How do I select an Option within an option box
    By mysterymouse in forum Microsoft Access Help
    Replies: 1
    Last Post: November 12th, 2009, 08:58 PM
  2. Second SELECT menu content based on first SELECT option?
    By bazzanoid in forum ASP Development
    Replies: 2
    Last Post: October 2nd, 2009, 10:01 AM
  3. Using ASP to automaticly select a option in option box
    By sweetorangepie in forum ASP Development
    Replies: 1
    Last Post: July 15th, 2008, 10:23 AM
  4. Pre select option in select statement
    By asp_dev in forum ASP Development
    Replies: 11
    Last Post: July 18th, 2007, 08:57 AM
  5. Select Option Group option based on Checkbox value
    By cmhnz in forum Microsoft Access Help
    Replies: 2
    Last Post: August 23rd, 2005, 06:35 AM

IMN logo majestic logo threadwatch logo seochat tools logo