jQuery UI Widgets › Forums › General Discussions › Editors › CheckBox, RadioButton › get value
Tagged: Button, jQuery Button, jquery radiobutton, radiobutton
This topic contains 5 replies, has 4 voices, and was last updated by Peter Stoev 12 years, 11 months ago.
-
Authorget value Posts
-
Hi all!
Is there a way to get the value of the radiobutton selected?
I want to do it without using events.Thanks
Hi levieu,
You can use the RadioButton’s checked property to get or set its state.
For example:
var isChecked = $("#jqxRadioButton").jqxRadioButton('checked');
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comCheckbox values can’t be used as part of a form submission?
i.e., dataString = jQuery(“#myForm”).serialize();
Hi Rob,
You have 2 options as a solution:
– Add hidden inputs to your Form and update their values depending on the checkbox’s value.
– Submit the Form with Ajax.Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
how can I get the value to my hidden input field from cklicked button:
<script type="text/javascript"> $(document).ready(function () { var theme = getTheme(); $("#jqxSubmitButton").jqxButton({ width: '150', height: '25'}); $("#E").jqxButtonGroup({ theme: theme, mode: 'default' }); $("#E").bind('buttonclick', function (event) { var clickedButton = event.args.button; $("#eventsLog").html("Clicked: " + clickedButton[0].id); $("#Erythromycin").value(clickedButton[0].id); }); }); </script></head><body> <form action="input007.php" method="POST"> <div id='E'> <button style="padding:4px 16px;" id="Res">R</button> <button style="padding:4px 16px;" id="Emed">M</button> <button style="padding:4px 16px;" id="Esens">S</button> </div> <input type="hidden" id ="Erythromycin" name="Erythromycin" value=""> <div> <input style='margin-top: 200px;' type="submit" name="Submit" id='jqxSubmitButton' /> </div> </form> <div id="eventsLog" style="margin-top: 10px;"> </div>
Where is my error? Please explain me.
Thanks,
Liquemin.
Isn’t it more correctly to write: $(“#Erythromycin”).val(clickedButton[0].id); instead of calling a value method?
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.