Ok I did it. I have one Checkbox and one Next Page button. I applied the code on Next Page and have Checkbox checked to go to next page. below is the code:
----- form1.#subform[0].NextPage::click: - (JavaScript, both) --------------------------------------
// Go to the next page.
if
(CheckBox1.rawValue == 1){
xfa.host.messageBox("Submitting the form");
xfa.host.pageDown( );
/****
Place all your Submission code in this place.
**/
}
else
{
xfa.host.messageBox("Please enter the Mandatory fields before submitting the form");
}
//xfa.host.pageDown( );
Thank you so much for giving me head start.