This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validate a ajax dropdown

 
Rajesh Veluchamy
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • 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
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • 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
  • 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".
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Satish Chilukuri
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use either the CSS display or visible properties to hide/unhide an element.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic