javascript drop down list for state state selection doesn't work

Discussion in 'Javascript' started by JRough, Oct 7, 2009.

  1. JRough

    JRough Guest

    Can you see what is wrong with this state field, form input? I get
    an error in php that says Unknown column 'state' in 'field list'
    which makes me think that the value isn't getting posted in the form.
    Can you let me know I did wrong or if the Javascript is right? There
    is more to the form I'm just giving you the field that doesnt' work.
    thanks,

    <label for="state">State</label>
    <select id = "state" name = "state"> onChange="this.form.getElementByID
    ("state").value=this[this.selectedIndex].value">
    <option value="AL">Alabama
    <option value="AK">Alaska
    <option value="AZ">Arizona
    <option value="AR">Arkansas
    <option value="CA">California
    <option value="CO">Colorado
    <option value="CT">Connecticut
    <option value="DE">Delaware
    <option value="FL">Florida
    <option value="GA">Georgia
    <option value="HI">Hawaii
    <option value="ID">Idaho
    <option value="IL">Illinois
    <option value="IN">Indiana
    <option value="IA">Iowa
    <option value="KS">Kansas
    <option value="KY">Kentucky
    <option value="LA">Louisiana
    <option value="ME">Maine
    <option value="MD">Maryland
    <option value="MA">Massachusetts
    <option value="MI">Michigan
    <option value="MN">Minnesota
    <option value="MS">Mississippi
    <option value="MO">Missouri
    <option value="MT">Montana
    <option value="NE">Nebraska
    <option value="NV">Nevada
    <option value="NH">New Hampshire
    <option value="NJ">New Jersey
    <option value="NM">New Mexico
    <option value="NY">New York
    <option value="NC">North Carolina
    <option value="ND">North Dakota
    <option value="OH">Ohio
    <option value="OK">Oklahoma
    <option value="OR">Oregon
    <option value="PA">Pennsylvania
    <option value="RI">Rhode Island
    <option value="SC">South Carolina
    <option value="SD">South Dakota
    <option value="TN">Tennessee
    <option value="TX">Texas
    <option value="UT">Utah
    <option value="VT">Vermont
    <option value="VA">Virginia
    <option value="WA">Washington
    <option value="WV">West Virginia
    <option value="WI">Wisconsin
    <option value="WY">Wyoming
    </select>
    <input id="state" size="2" name="state">
     
    JRough, Oct 7, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    548
    Cowboy \(Gregory A. Beamer\)
    Oct 6, 2006
  2. weiwei
    Replies:
    0
    Views:
    1,072
    weiwei
    Jan 5, 2007
  3. jaysch
    Replies:
    0
    Views:
    1,274
    jaysch
    Apr 30, 2011
  4. Replies:
    5
    Views:
    317
  5. JRough
    Replies:
    3
    Views:
    343
    Evertjan.
    Oct 7, 2009
Loading...

Share This Page