Hi,I am trying to check whether a field’s (Type Radio Button) value is blank or not in web.
Java script cannot trap the field value of a radio button field.
So I tried to write the following code in the HTML Head Content of the form and then called the function in the onSubmit event of the form, but its generating error, in the status bar of IE its showing “Object Required” pls help.
x := @Text (SupervisorLevel);
y := @If ( x = “” ; @ERROR ; x);
“<script language="JavaScript" >” + @NewLine +
"<!-- " + @NewLine +
“function checkSupervisorLevel() {” + @NewLine +
“var form = document.forms[0];” + @NewLine +
“var supervisorcheck = "0";” ; + @NewLine +
@If(@IsError(y); @Return (“”);“”) + @NewLine +
“if(supervisorcheck == "1") {return true} else {alert("** You need to select a Supervisory Level **";); return false;}” + @NewLine +
Suggest you use the JSHeader for the form, not the HTML Head Content - this will make it easier to write your JavaScript and will place it in the block automatically.
Subject: RE: Radio Button field validation in web.
Hi,
I am facing another problem. since I am calling the function in the onSubmit event of the form, the form gets submitted even if it does not pass the validation.
I tried it but the problem exists. When I transfered the on submit code to a button, it throwing error saying that the object does not support the property or method.