Hi all,
I'm trying to add a button to a custom SuiteScript page I've created that will reset (blank out) all available user entry fields after the initial POST. My script currently uses the "addResetButton" on the GET request side, and this works fine - i.e., it clears all fields.
After the user presses the Submit button, my script performs a search based on the fields that they entered data into, to which I then populate all the user entry fields with a "setDefaultValue" of what they originally typed in such that the page looks exactly as it did prior to them pressing Submit (except for the results sublist of course). Now I'm not sure if this is already where I'm going wrong - perhaps there's another way I should be refreshing the screen to simply populate the sublist, but that's what I currently have and it's working fine.
What happens though, is if I use another "addResetButton" in the POST side, it will only clear text entered by the user since pressing Submit, so I was attempting to use the "form.addButton('custreset', 'Reset', resetscript);" API where my resetscript parameter would either call another function, or would perform an activity, but I can't seem to see how I use this script parameter. All I can see on NetSuite's help pages is:
[INDENT]script {string} [optional]- The onclick script used for this button
[/INDENT]
And the only example they show is:
[INDENT]var script = "alert('Hello World')";
form.addButton('custombutton', 'Click Me', script);[/INDENT]
How else can I use this script parameter? Can I call a function from this parameter?
Thanks ever so much in advance.
Regards,
K.