Hi,
Is there a way that the fields can be highlighted using the required field validation without clicking the Submit button. I have something like a validate button which is a regular button, but that doesn't seem the work with the same code in it. The Submit button highlights the madatory fields and pops-up an error message. My requirement needs both the buttons to be repsent on the form. Please help.
Regards,
NG
Solved! Go to Solution.
Views
Replies
Total Likes
It took some time to figure it out..
We are trying to set the color and thickness but the edge presence was hidden. You need to make the edge visible..
Use the below code to make it work for you..
EFormsData.Page1.pageSelection.formsIntro.coverDetails.busNam.border.edge.presence = "visible";
EFormsData.Page1.pageSelection.formsIntro.coverDetails.busNam.border.edge.color.value = "252,28,3";
EFormsData.Page1.pageSelection.formsIntro.coverDetails.busNam.border.edge.thickness = "2.5pt";
Note: You have already made the field as User Entered -Required. Then the Reader/ Acrobat will place a Red Border around the field by default for all mandatory fields. Also you have a function at the time of initialize to make the field as mandatory.
If you want to test the above code, you need to comment out the initialize event code to call the Validate function, and change the field to User Entered - Optional.
Thanks
Srini
Views
Replies
Total Likes
You can try using the Validate event of the fields that you want to be mandatory. If the validation fails, then you can highlight the field.
For highlighting you can use some thing like this.
var strFieldName = this.somExpression;
var strField = xfa.resolveNode(strFieldName + ".ui.#textEdit.border.fill.color");
strField.value = "255,255,255"; // RGB color Value that will highlight the field.
You need to change the ui reference based on the type of control you are using.
Date field = #dateTimeEdit
Dropdown = #choiceList
Checkbox = #checkButton
Text field = #textEdit
Numeric field = #numericEdit
Thanks
Srini
Views
Replies
Total Likes
Thanks for the prompt response Srini.
I tried this out, however, I filles the entire field with the specified color. I just need to color the edges of the field. I tried using
..textEdit.border.edge.color.., but thus colors only the one border, the top one. I even tried ..textEdit.border.edge[2].color.., but this didn't color any of the edges. The appearance of my field is solid as per the requirement.
Views
Replies
Total Likes
If you just want to highlight the border try using this.. Where fieldname is TextField1. Change it to your field name..
TextField1.border.edge.color.value = "207,29,3";
If it is only hightlighting one side of the border, did you place this control inside a table row?
If it is in Table row, the color of field borders can conflict with the borders of the Row and Table, the next cell, the previous cell, the cell above, the cell below etc..
Thanks
Srini
Views
Replies
Total Likes
this too ins't helping. Itsnot chaning the color for any of the edges.
Views
Replies
Total Likes
Views
Replies
Total Likes
I have sent you the form. Plz let me know if you have any queries in that.
Views
Replies
Total Likes
It took some time to figure it out..
We are trying to set the color and thickness but the edge presence was hidden. You need to make the edge visible..
Use the below code to make it work for you..
EFormsData.Page1.pageSelection.formsIntro.coverDetails.busNam.border.edge.presence = "visible";
EFormsData.Page1.pageSelection.formsIntro.coverDetails.busNam.border.edge.color.value = "252,28,3";
EFormsData.Page1.pageSelection.formsIntro.coverDetails.busNam.border.edge.thickness = "2.5pt";
Note: You have already made the field as User Entered -Required. Then the Reader/ Acrobat will place a Red Border around the field by default for all mandatory fields. Also you have a function at the time of initialize to make the field as mandatory.
If you want to test the above code, you need to comment out the initialize event code to call the Validate function, and change the field to User Entered - Optional.
Thanks
Srini
Views
Replies
Total Likes
Thats perfect!!!!!!!
It worked. Thanks a lot for helping me resolve this within a day.
Views
Replies
Total Likes
Views
Likes
Replies