I am trying to populate a field on my webform based on the selection from the Dropdown list of another field on the form. For example: If I select "1st Place" from the Dropdown list I would like the Points field to be populated with the value of 4.
I am using the following JavaScript in the Footer of the Submission Form.
<SCRIPT LANGUAGE="JavaScript">
function getPts()
{
/* Retrieve the value of the field Cookoff_Result_Place and store in a variable 'Place' */
var Place = document.getElementById("InsertRecordCookoff_Result_Place").value;
switch (Place)
{
case '1': case '11': case '14': case '17': case '20': document.getElementById("InsertRecordCookoff_Result_Points").value=4;
break;
case '2': case '12': case '15': case '18': case '21': document.getElementById("InsertRecordCookoff_Result_Points").value=3;
break;
case '3': case '13': case '16': case '19': case '22': document.getElementById("InsertRecordCookoff_Result_Points").value=2;
break;
default: document.getElementById("InsertRecordCookoff_Result_Points").value=1
}
}
/* On submitting the webform, the function getPts is executed */
document.getElementById("caspioform").onsubmit=getPts;
</SCRIPT>
Everything works while I am in Caspio but when I deploy the form to my website it stops populating the Points field. I'm not sure what needs to be changed to get it to work from my website.
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
rollandpate
I am trying to populate a field on my webform based on the selection from the Dropdown list of another field on the form. For example: If I select "1st Place" from the Dropdown list I would like the Points field to be populated with the value of 4.
I am using the following JavaScript in the Footer of the Submission Form.
Everything works while I am in Caspio but when I deploy the form to my website it stops populating the Points field. I'm not sure what needs to be changed to get it to work from my website.
Link to comment
Share on other sites
3 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.