Jump to content

charlene

Members
  • Posts

    3
  • Joined

  • Last visited

charlene's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, Can anyone tell me why my three functions cannot work at the same time? Thanks! <SCRIPT LANGUAGE="JavaScript"> function myFunctionV1() { alert("Fucntion1"); var par1 = document.getElementById("EditRecordV1_OnRoadClass8").value; var par2 = document.getElementById("EditRecordV1_ExemptTruck").value; var par3 = document.getElementById("EditRecordV1_DieselFueled").value; var par4 = document.getElementsByName("EditRecordV1_MeetVMTReqt")[0].value; var par5 = document.getElementById("EditRecordV1_WillMeetVMTReqt").value; var par6 = document.getElementById("EditRecordV1_Made150Trip").value; var par7 = document.getElementById("EditRecordV1_WillMake150Trip").value; if(par1 == 'Yes' && par2 == 'Yes' && par3 == 'Yes' && par4 == 'Yes' && par5 == 'Yes' && par6 == 'Yes' && par7 == 'Yes') {document.getElementById("EditRecordV1_Eligibility").value = "Eligible";} else {document.getElementById("EditRecordV1_Eligibility").value = "NotEligible";} } function myFunctionV2() { alert("Fucntion2"); var par21 = document.getElementById("EditRecordV2_OnRoadClass8").value; var par22 = document.getElementById("EditRecordV2_ExemptTruck").value; var par23 = document.getElementById("EditRecordV2_DieselFueled").value; var par24 = document.getElementsByName("EditRecordV2_MeetVMTReqt")[0].value; var par25 = document.getElementById("EditRecordV2_WillMeetVMTReqt").value; var par26 = document.getElementById("EditRecordV2_Made150Trip").value; var par27 = document.getElementById("EditRecordV2_WillMake150Trip").value; if(par21 == 'Yes' && par22 == 'Yes' && par23 == 'Yes' && par2v4 == 'Yes' && par2v5 == 'Yes' && par2v6 == 'Yes' && par27 == 'Yes') {document.getElementById("EditRecordV2_Eligibility").value = "Eligible";} else {document.getElementById("EditRecordV2_Eligibility").value = "NotEligible";} } function myFunctionV3() { alert("Fucntion3"); var par31 = document.getElementById("EditRecordV3_OnRoadClass8").value; var par32 = document.getElementById("EditRecordV3_ExemptTruck").value; var par33 = document.getElementById("EditRecordV3_DieselFueled").value; var par34 = document.getElementsByName("EditRecordV3_MeetVMTReqt")[0].value; var par35 = document.getElementById("EditRecordV3_WillMeetVMTReqt").value; var par36 = document.getElementById("EditRecordV3_Made150Trip").value; var par37 = document.getElementById("EditRecordV3_WillMake150Trip").value; if(par31 == 'Yes' && par32 == 'Yes' && par33 == 'Yes' && par34 == 'Yes' && par35 == 'Yes' && par36 == 'Yes' && par37 == 'Yes') {document.getElementById("EditRecordV3_Eligibility").value = "Eligible";} else {document.getElementById("EditRecordV3_Eligibility").value = "NotEligible";} } document.getElementById("caspioform").onsubmit=myFunctionV1; document.getElementById("caspioform").onsubmit=myFunctionV2; document.getElementById("caspioform").onsubmit=myFunctionV3; </SCRIPT>
  2. Thanks Jan. I had the code below, but it doesn't seem to work. Could you please help me take a look at it? My form is an update form. <SCRIPT LANGUAGE="JavaScript"> function myFunction() { var virtual1 = document.getElementById("EditRecordV1_ExemptTruck").value; var virtual2 = document.getElementById("EditRecordV1_OnRoadClass8").value; if (virtual1=='Yes') { if (virtual2=='Yes') { document.getElementById("EditRecordfield3").value = "Eligible"; } else { document.getElementById("EditRecordfield3").value = "InEligible"; } } else { document.getElementById("EditRecordfield3").value = "InEligible"; } } document.getElementById("caspioform").onsubmit=myFunction; </SCRIPT> Do I need to change the name of my form to be "caspio form" to match the last command?
  3. Hi, How could I create a script code to store a data field value based on the if or else conditions? What I am trying to achieve is that If both field 1 and field 2 equal "Yes", then store a value of "Eligible" in field 3 Else store a value of "InEligible" in field 3. Please help. Thank you!
×
×
  • Create New...