In this example Name is the name of the field and needs to be changed for each Input Validation formula. (There is a new way of doing this in Rnext see the section)
thisField:="Name";
@If( Name="" & @clienttype="Web";
@Failure("<b>Please Complete the Form</b><br>"+
" " + thisField + " should be answered." +
"<br><br>"+"<form>"+"<input type=\'button\' value=\'Back\' onclick=\'history.back();\'>");
Name="";
@Failure( thisField+ " should be answered." );
@Success)
If you have many fields, this method will allow you to change to style of the message quickly: add this to a computed field called "InputValErrStart"
"<b>Please Complete the Form</b><br>"
Another computed when composed field: "InputValErrEnd"
"<br><br>"+"<form>"+"<input type=\'button\' value=\'Back\' onclick=\'history.back();\'>"
and then use this code:
thisField:="Name"
@If( Name="" & @clienttype="Web"
@Failure( InputValErrStart+" " + thisField + " should be answered." + InputValErrEnd);
Name=""
@Failure( thisField+ " should be answered." );
@Success)
The Save button formula should be:
r:=@Command([FileSave]);
@If(r=0;
@Return("");
@URLOpen("http://www.adfos.com"))
Change @URLOpen to whatever you wish to direct the user to after they have correctly entered the data.