• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

validate a ajax dropdown

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am creating a dropdown box using ajax.Now i want to check whether he(user) has selected value from that. i am getting object not found error, since that will be created only at runtime
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We can not read minds here. We need to see some code if you really expect us to help you out.

Normally object expected means that you are trying to reference an object that is not on the page. So that means you either are not adding it to the page correctly or referencing it before it is there.

Eric
 
Rajesh Veluchamy
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am sorry if i am not able to specify clearly



since "dropdownSuspType" variable is not in main page, and it comes from ajax. i am getting error


If the use is not selecting status and it's default("Please Select") is selected then i should display alert "Please select status".
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You really shouldn't be transferring a complete select element from the server. If you already have that element on the page, and just hidden until needed, simply return the results that should be displayed as options for the select only. Populate the select with the options returned from the server.

And when I say options I don't mean return



I mean, return the value/label pairs from the server. There are examples all over the web on how to do this.
 
Rajesh Veluchamy
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Gregg,
Is it possible to hide a dropdown box i.e, <select></select>

Till now i know only "<input type=hidden/>"

My requirement now is, the dropdown should be visable to user only when he click one option button
 
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use either the CSS display or visible properties to hide/unhide an element.
 
reply
    Bookmark Topic Watch Topic
  • New Topic