I'm trying to set up validation for mandatory fields in Adobe Designer 7.0.
Moved to a different solution but it still falls over!
The validation now takes place once the user clicks on Submit. It checks to see whether there is a value and returns an error message if a mandatory field has not been completed.
It works but after entering a value in the blank field and then clicking on submit it returns an error message.
----- form1.#subform[0].submit::click - (FormCalc, client) -----------------------------------------
var mess
var sf
if (all_ok <> 1) then
if ( requestor_details.requestor_name.rawValue == null ) then
mess = "Please enter the name of the requestor"
sf = "requestor_details.requestor_name"
all_ok = 1
endif
endif
if (all_ok <> 1) then
if ( requestor_details.directorate.rawValue == null ) then
mess = "Please enter the name of the directorate e.g. IWS, UKTI SG etc"
sf = "requestor_details.directorate"
all_ok = 1
endif
endif
if (all_ok <> 1) then
if ( requestor_details.tel_number.rawValue == null ) then
mess = "Please enter your telephone number"
sf = "requestor_details.tel_number"
all_ok = 1
endif
endif
if (all_ok <> 1) then
if ( requestor_details.organisation.rawValue == null ) then
mess = "Please choose the relevant organisation name from the drop down list"
sf = "requestor_details.organisation"
all_ok = 1
endif
endif
if (all_ok <> 1) then
// submitHidden.execEvent("click")
$host.messageBox("Form complete")
else
$host.messageBox(mess,"Message")
$host.setFocus(sf)
endif