How Do I Set A Radio Button Value, Based on Another Button's Value?


Badge +9

I'm having trouble getting this to work. I can clear the Approve radio button value with .prop("checked", false);, but can't set its value (initially empty) using the method marked in red below:

var DecisionRB = NWF$('#' + Decision);

DecisionRB.click(function() {
if (DecisionRB.val()=="Recommend") {
NWF$('#' + Approve[value="No"]).prop("checked",true);
}
})


2 replies

Userlevel 2
Badge +11

In stead of .prop("checked","true") try .attr("checked","true")

Badge +9

This worked, from another post (after much digging, thanks Marian Hatala‌)

.find('input:radio[value="No"]').click();

Reply