MayMusic Posted September 28, 2011 Report Share Posted September 28, 2011 How can I check a radio button based on a textfield value in an entry form? For example if the user enters "first" the then first checkbox get checked? Any Ideas? Quote Link to comment Share on other sites More sharing options...
nkamalan Posted September 28, 2011 Report Share Posted September 28, 2011 You can have something like the example below in an HTML block or Footer of your page: function checkTxt(){ var txt = document.getElementById("InsertRecordFieldName").value; if (txt == "First" || txt == "first") { document.getElementById("InsertRecordFieldName0").checked= true; } else if (txt == "Second" || txt == "second"){ document.getElementById("InsertRecordFieldName1").checked= true; } else if (txt == "Third" || txt == "third"){ document.getElementById("InsertRecordFieldName2").checked= true; } } document.getElementById("InsertRecordname").onkeyup=checkTxt; InsertRecordFieldName0 refers to the first radio button, you can use firebug to get the field ID and replace it here. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.