Objective: On submission of a web update form, write "Yes" or "No" to a text field based on the selections made to three different radio buttons in the same form.
Radio button 1 (text field name = Question 1): values are "YES" or "NO"
Radio button 2 (text field name = Question 2): values are "YES" or "NO"
Radio button 3 (text field name = Question 3): values are "YES" or "NO"
The field named "user_profile_complete" is a Text Field (255).
The text field "user_profile_complete" should be updated to say "Yes" if all three radio buttons were selected "NO."
If any of the three radio buttons were selected "Yes" then the text field "user_profile_complete" should be updated to say "No."
This is a single record update form.
Below is Javascript I have written to accomplish this task but it is not working. I have this script placed in the footer of the Datapage containing all the elements listed above.
Please help.
________________________________________
function setcomplete()
{
var q1 = document.getElementById("EditRecordQuestion_1").value;
var q2 = document.getElementById("EditRecordQuestion_2").value;
var q3 = document.getElementById("EditRecordQuestion_3").value;
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.
Question
thirdcircle
Objective: On submission of a web update form, write "Yes" or "No" to a text field based on the selections made to three different radio buttons in the same form.
Radio button 1 (text field name = Question 1): values are "YES" or "NO"
Radio button 2 (text field name = Question 2): values are "YES" or "NO"
Radio button 3 (text field name = Question 3): values are "YES" or "NO"
The field named "user_profile_complete" is a Text Field (255).
The text field "user_profile_complete" should be updated to say "Yes" if all three radio buttons were selected "NO."
If any of the three radio buttons were selected "Yes" then the text field "user_profile_complete" should be updated to say "No."
This is a single record update form.
Below is Javascript I have written to accomplish this task but it is not working. I have this script placed in the footer of the Datapage containing all the elements listed above.
Please help.
________________________________________
function setcomplete()
{
var q1 = document.getElementById("EditRecordQuestion_1").value;
var q2 = document.getElementById("EditRecordQuestion_2").value;
var q3 = document.getElementById("EditRecordQuestion_3").value;
var y = "Yes"
var n = "No"
if (q1 == 'NO') && (q2 == 'NO') && (q3 == 'NO')
{
document.getElementById("EditRecorduser_profile_complete").value=y;
}
else
{
document.getElementById("EditRecorduser_profile_complete").value=n;
}
}
/* On submitting the webform, the function setcomplete is executed */
document.getElementById("caspioform").onsubmit=setcomplete;
Link to comment
Share on other sites
2 answers to this question
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.