forms - not getting radio button values in jquery ajaxform -
I have a form that is linked to a JQuery form (AjaxForm) object.
In the form I have some radio buttons:
& lt; Input type = "radio" id = "dialog_stranka_dodajuredi_tip_fizicna" name = "dialog_stranka_dodajuredi_tip" value = "2" /> Selection 2 & lt; Input type = "radio" id = "dialog_stranka_dodajuredi_tip_pravna" name = "dialog_stranka_dodajuredi_tip" value = "1" /> Selection 1
Now, when the form is posted via AJAX, the parameter "dialog_stranka_dodajuredi_tip" is empty.
I also tried to force the incident of a change like this:
$ ('input [(' 'change' '(function) (switch (persian) (Case of Alert ('Number 2 has been selected)'); Pause; Case 1: Warning ('No.1 (' Input [name = Dialog_straca_dodojoyed_tip]: checked '). Val ())) {Case 2: Alert Selection of '); break;}});
But the value of the property of Val is not worth the warning box pops up.
Using debug And set the clocks at this point and this is the result (value):
$ ('input [name = dialog_stranka_dodajuredi_tip]'). Val () - & gt; Value: "dialog_stranka_dodajuredi_tip_pravna" $ ('input [name = dialog_stranka_dodajuredi_tip]: checked' id ('id') - & gt; Value: '' $ '(' input [name = dialog_star_dodojoyed_tip]: checked '). Attr ('name') - & gt; value: "dialog_stranka_dodajuredi_tip" $ ('input [name = dialog_stranka_dodajuredi_tip]: checked'). Val () -> Value: ""
As you can see, Val () does not return any value only, though Is set somewhere tags. I do not know, any thoughts?
By adding quotation marks '
name itself fixed this problem for me Such as:
switch (parseInt ($ ("input [name = 'dialog_stranka_dodajuredi_tip']: checked"). Val ())) {...
< / Pre>
Comments
Post a Comment