Re: Validation Xbasic
So, we got it. The validation "CANNOT BE BLANK" just needs to go away once something is in the field.
So, we got it. The validation "CANNOT BE BLANK" just needs to go away once something is in the field.
Alpha Software Mobile Development Tools: Alpha Anywhere | Alpha TransForm |
function setShip as c (e as p) dim validated[0] as p dim allValidated as c = "" dim js as c dim varJS[0] as p dim tracker as n = 0 dim ShipFName as c = e.dataSubmitted.ShipFName dim ShipLName as c = e.dataSubmitted.ShipLName dim ShipAdd1 as c = e.dataSubmitted.ShipAdd1 varJS[].original = <<%txt% $('<swap2>').innerHTML = "<swapit>      <font color=\"red\"> CANNOT BE BLANK</font>"; %txt% varJS[].original = <<%txt% $('<swap2>').innerHTML = "<swapit>"; %txt% validated[].swap = "First Name" validated[..].swap2 = "fn" validated[..].fieldVal = shipFname 'e.dataSubmitted.ShipFName validated[].swap = "Last Name" validated[..].swap2 = "ln" validated[..].fieldVal = shipLname 'e.dataSubmitted.ShipLName validated[].swap = "Shipping Address1" validated[..].swap2 = "a1" validated[..].fieldVal = ShipAdd1 'e.dataSubmitted.ShipAdd1 js = "" debug(1) for each fld in validated tempJS = varJS[1].original tracker = tracker+1 if isnull(validated[tracker].fieldVal) then allValidated = "false" '''tempJS = "$('<swap2>').innerHTML = '<swapit>      <font color=\"red\"> CANNOT BE BLANK</font>';" tempJS = strtran(tempJS,"<swapit>",validated[tracker].swap) tempJS = strtran(tempJS,"<swap2>",validated[tracker].swap2) js = js + tempJS else tempJS = varJS[2].original tempJS = strtran(tempJS,"<swapit>",validated[tracker].swap) tempJS = strtran(tempJS,"<swap2>",validated[tracker].swap2) js = js + tempJS end if next if allValidated <> "false" then tracker = 0 for each fld in validated tempJS = varJS[2].original tracker = tracker+1 if .not. isnull(validated[tracker].fieldVal) then allValidated = "false" tempJS = "$('<swap2>').innerHTML = '<swapit>';" tempJS = strtran(tempJS,"<swapit>",validated[tracker].swap) tempJS = strtran(tempJS,"<swap2>",validated[tracker].swap2) js = js + tempJS end if next end if setShip = js end function
js = js + "$('val').innerHTML = 'All done and continuing on....';"
function setShip as c (e as p) dim validated[0] as p dim allValidated as c = "" dim js as c dim varJS[0] as p dim tracker as n = 0 varJS[].original = <<%txt% $('<swap2>').innerHTML = "<swapit>      <font color=\"red\" size=\"1\"> CANNOT BE BLANK</font>"; %txt% varJS[].original = <<%txt% $('<swap2>').innerHTML = "<swapit>"; %txt% validated[].swap = "First Name" validated[..].swap2 = "fn" validated[..].fieldVal = e.dataSubmitted.ShipFName validated[].swap = "Last Name" validated[..].swap2 = "ln" validated[..].fieldVal = e.dataSubmitted.ShipLName validated[].swap = "Address Line 1" validated[..].swap2 = "a1" validated[..].fieldVal = e.dataSubmitted.ShipAdd1 'This is the Address Line 2 which normally is the Apartment number or Suite. Un-Comment out the 3 following lines to validate it. 'validated[].swap = "Address Line 2" 'validated[..].swap2 = "a2" 'validated[..].fieldVal = e.dataSubmitted.ShipAdd2 validated[].swap = "City" validated[..].swap2 = "ct" validated[..].fieldVal = e.dataSubmitted.ShipCity validated[].swap = "State" validated[..].swap2 = "st" validated[..].fieldVal = e.dataSubmitted.ShipState validated[].swap = "Zip Code" validated[..].swap2 = "zip" validated[..].fieldVal = e.dataSubmitted.ShipZip validated[].swap = "Country" validated[..].swap2 = "cy" validated[..].fieldVal = e.dataSubmitted.ShipCountry validated[].swap = "Shipping Options" validated[..].swap2 = "sm" validated[..].fieldVal = e.dataSubmitted.ShipType js = "" 'debug(1) for each fld in validated tempJS = varJS[1].original tracker = tracker+1 if isnull(validated[tracker].fieldVal) then allValidated = "false" tempJS = strtran(tempJS,"<swapit>",validated[tracker].swap) tempJS = strtran(tempJS,"<swap2>",validated[tracker].swap2) js = js + tempJS else tempJS = varJS[2].original tempJS = strtran(tempJS,"<swapit>",validated[tracker].swap) tempJS = strtran(tempJS,"<swap2>",validated[tracker].swap2) js = js + tempJS end if next if allValidated <> "false" then tracker = 0 for each fld in validated tempJS = varJS[2].original tracker = tracker+1 if .not. isnull(validated[tracker].fieldVal) then allValidated = "false" tempJS = "$('<swap2>').innerHTML = '<swapit>';" tempJS = strtran(tempJS,"<swapit>",validated[tracker].swap) tempJS = strtran(tempJS,"<swap2>",validated[tracker].swap2) js = js + tempJS end if next js = js + "$('val').innerHTML = 'All done and continuing on....';" 'This is where the next step goes. Typically would be the script to process the form results. end if setShip = js end function
Comment