[jQuery] Re: (Validation) how to add validation on a select box with auto post

2009-07-13 Thread 刘永杰
is it difficult?$(#State).val()

2009/7/13 mnaveed mnaveed...@gmail.com


 Hi,
 I have a select box with and onchange event to get the data from
 serever,

 SELECT name=States id=Stateonchange=getData(this.value) 


 Now i want to validate that if no value is selected from the above
 list, then it should not send the ajax request. How can i apply the
 Jquery validation plugin here?

 Thanks.


[jQuery] Re: (Validation) how to add validation on a select box with auto post

2009-07-13 Thread mnaveed

I am using the JQuery Validation plug in to validate my form. How can
i do this with that?


On Jul 13, 1:34 pm, 刘永杰 liuyongjie...@gmail.com wrote:
 is it difficult?$(#State).val()

 2009/7/13 mnaveed mnaveed...@gmail.com



  Hi,
  I have a select box with and onchange event to get the data from
  serever,

  SELECT name=States id=State        onchange=getData(this.value) 

  Now i want to validate that if no value is selected from the above
  list, then it should not send the ajax request. How can i apply the
  Jquery validation plugin here?

  Thanks.


[jQuery] Re: (Validation) how to add validation on a select box with auto post

2009-07-13 Thread 刘永杰
sorry!i didn't use JQuery Validation plug in.

2009/7/13 mnaveed mnaveed...@gmail.com


 I am using the JQuery Validation plug in to validate my form. How can
 i do this with that?


 On Jul 13, 1:34 pm, 刘永杰 liuyongjie...@gmail.com wrote:
  is it difficult?$(#State).val()
 
  2009/7/13 mnaveed mnaveed...@gmail.com
 
 
 
   Hi,
   I have a select box with and onchange event to get the data from
   serever,
 
   SELECT name=States id=Stateonchange=getData(this.value)
 
 
   Now i want to validate that if no value is selected from the above
   list, then it should not send the ajax request. How can i apply the
   Jquery validation plugin here?
 
   Thanks.



[jQuery] Re: (Validation) how to add validation on a select box with auto post

2009-07-13 Thread Mean Mike

what you should do is take the onchange event out of the html and put
it into a document ready

like this

$(document).ready(function(){
$(#State).change(function() {
//check to see if the feild has a value
if ($(this).val() != ){
//ok lets get the data then
getData(($this).val())
}
});
});

I think this is what you wanted to test for

Mean Mike
On Jul 13, 4:22 am, mnaveed mnaveed...@gmail.com wrote:
 Hi,
 I have a select box with and onchange event to get the data from
 serever,

 SELECT name=States id=State         onchange=getData(this.value) 

 Now i want to validate that if no value is selected from the above
 list, then it should not send the ajax request. How can i apply the
 Jquery validation plugin here?

 Thanks.