I have
a form that I need to require that two text fields be
user entered before they click my email send button. I am
not using a submit buttun. Is there a script that I can use to stop them if they do not enter some text in those two fields?
Views
Replies
Total Likes
If you are not using a submit button how are you generating the email?
Paul
Views
Replies
Total Likes
A click event with java and a button. It works very well
var oDoc = event.target;
oDoc.mailDoc()
Views
Replies
Total Likes
Set the fields that you want to force to be filled as User Entered Required (on theObject/Value tab under the TYpe dropdown). This makes the fields required. Now modify the code on your email button to do this:
if (form1.execValidate() == true){
var oDoc = event.target;
oDoc.mailDoc()
} else {
app.alert("There are mandatory fields not field yet!")
app.runtimeHighlight = true;
}
Where form1 is the root node (in the hierarchy of your form). In the else portion I put a message box there just to show you how it works. Note that the product will generate a default message as well. The app.runtimeHighlight will turn on the field highlighting and will mark and required field in a red border.
Paul
Views
Replies
Total Likes
Thank you, I will try this
Views
Replies
Total Likes
if (Page1.execValidate() == true){
var oDoc = event.target;
oDoc.mailDoc()
} else {
app.alert("There are mandatory fields not field yet!")
app.runtimeHighlight = true;
}
bUI: true,
cTo: "customerservice@jobesvcs.com",
cMsg: "These are Invoices & Schedule sent from Client#
"form1.Page1.Header.ClientId.rawValue","
form1.Page1.Header.ClientName.rawValue","+" With a schedule date of "
+form1.Page1.Footer.ScheduleDate.rawValue,
cSubject:"Client ID = " + form1.Page1.Header.ClientId.rawValue,
})
app.execMenuItem("Close");
This is my entire script
Views
Replies
Total Likes
I was given an error saying
Invalid Label
Views
Replies
Total Likes
Great, I had a little code wrong....Thanks for the great help, it works
Views
Replies
Total Likes
I have a date field that is a calculate java event that is throwing me a
curve. It is suppose to populate the current date if the field is empty.
When I open the form online it is saying 4-29-11 but when I click my add new
instance of the invoice it populates the field with 4-30-11 which is
correct. I opened the form off line and it populated the field with 4-30-11
when it opens. Here is the code;
if (this.rawValue == null){
var msNow = (new Date()).getTime();
var d1 = new Date(msNow);
this.rawValue = util.printd("mm/dd/yy", d1); } else { this.rawValue =
rawValue;
Can you see what may be wrong here?
Steve
Views
Replies
Total Likes