aukirk Posted December 3, 2011 Report Share Posted December 3, 2011 I am hoping someone can see a clear error in this code and help me. I am putting this script in the footer of the details page on a "Search and Report" DataPage. I am hoping to have and If... then statement where (a) if Field_A is set to the value "Pending", then Field_B has a value of "Incomplete", or ( if Field_A is set to the value "Done", then Field_B has a value of "Complete". Otherwise, there will be no change made to Field_B. Here is what I have: function checkstatus() { var a_status = document.getElementById("EditRecordField_A").value; var b_status = document.getElementById("EditRecordField_B").value; if (a_status == 'Pending') { b_status = 'Incomplete'; } if (a_status == 'Done') { b_status = 'Complete'; } document.getElementById('caspioform').onsubmit=checkstatus; Quote Link to comment Share on other sites More sharing options...
aukirk Posted December 4, 2011 Author Report Share Posted December 4, 2011 I figured out that the problem was that one of those fields was radio buttons. By changing it to a drop down it works. Any suggestions on how to get this to work with radiobuttons? I am assuming they need to be referrenced in a different way? Quote Link to comment Share on other sites More sharing options...
casyana Posted December 5, 2011 Report Share Posted December 5, 2011 Hi Aukirk, Each option of radio button has own ID (EditRecordField_B0, EditRecordField_B1, etc). To select radio button you should use checked property: document.getElementById('EditRecordField_B0').checked = true; Thanks, Casyana. 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.