Hi Everyone,
I am seeking some help here and i am stuck for few days :h_a_w:
I am working on a Suitelet which creates a Form displaying different fields in GET method.
I have added 3 buttons:
* APPROVE calling a function checkApprove() as newForm.addButton('custpage_approveit','Approve', 'checkApprove('+salesorderID +')');
* REJECT calling a function checkReject() as newForm.addButton('custpage_rejectit', 'Reject', 'checkReject('+salesorderID +')');
* SUBMIT using newForm.addSubmitButton('Submit');
I want to verify the inputs of the user in all fields have added in the form (myform.addfield...) and alert the user of any information wrongly input, and if ok (and only if all OK) submit the form to POST
WAY 1:
The 2 functions checkApprove() and checkReject are on a Clientscript and are working fine.
Since the submit button doesn't let me verify the input of the User (except for Mandatory field) I am trying to use these 2 functions (APPROVE & REJECT) to do some verification (example date later than today...)
Everything works fine, my function are called properly and do some alert or even some nlapiSubmitField nevertheless I am not able to force the function 'check' on the clientscript to submit the Form on the Suitelet. As i want to display the POST of that same Suitelet.
WAY2:
If i press the SUBMIT button the POST method is correctly called but since the test are not done. my code is throwing every time it receive an none authorised value (expected behaviour).
is it possible to go back to Get after pressing SUBMIT if requirements are not encountered .?
Thanks guys in advance for your help.