hi i have a problem i was using version 1.3 for jquery and i upgraded it to 1.8 and suddenly my code became buggy , i had 2 radio inputs with the name representative_ select[]
[code=html]
<input name="represent ative_select[]" type="radio" />
[/code]
and i need to check that if any one of these radio buttons is selected or not my previous working code was
[code=javascript]
if(jQuery("inpu t:radio[name=payment_op tion[]]:checked").leng th==0){
str+='Please Select a Payment option\n';
}
[/code]
and after upgrade i starting receiving syntax error i did some R&D and found that some functions are deprecated in the version 1.6+, so i changed it to the following but still no use as the square brackets need to be escaped so the \\ are used but still i am not doing it right here it is
[code=javascript]
if(jQuery(name= "representative _select\\[\\]").prop('checke d').length==0){
str+='\Select a Representative option';
}
[/code]
then i gave an id to the same input id='single_rep'
and then run these two statements
both of these statements alerted [object object]
but when i append the prop() function with the 2 statements
[code=javascript]
jQuery(name="re presentative_se lect\\[\\]").prop('checke d')
jQuery("#single _rep").prop('ch ecked')
[/code]
the first one says that prop is undefined and the second statement alerts true /false depending on the radio being checked or un-checked
can somebody help me in this regard that what do i need to do
[code=html]
<input name="represent ative_select[]" type="radio" />
[/code]
and i need to check that if any one of these radio buttons is selected or not my previous working code was
[code=javascript]
if(jQuery("inpu t:radio[name=payment_op tion[]]:checked").leng th==0){
str+='Please Select a Payment option\n';
}
[/code]
and after upgrade i starting receiving syntax error i did some R&D and found that some functions are deprecated in the version 1.6+, so i changed it to the following but still no use as the square brackets need to be escaped so the \\ are used but still i am not doing it right here it is
[code=javascript]
if(jQuery(name= "representative _select\\[\\]").prop('checke d').length==0){
str+='\Select a Representative option';
}
[/code]
then i gave an id to the same input id='single_rep'
and then run these two statements
Code:
alert(jQuery("#single_rep"));
alert(jQuery(name="representative_select\\[\\]"))
but when i append the prop() function with the 2 statements
[code=javascript]
jQuery(name="re presentative_se lect\\[\\]").prop('checke d')
jQuery("#single _rep").prop('ch ecked')
[/code]
the first one says that prop is undefined and the second statement alerts true /false depending on the radio being checked or un-checked
can somebody help me in this regard that what do i need to do
Comment