javascript - Separating the POST requests of a Suitelet -


my goal attach custom submit button suitelet sends post request external server. problem having when rendering page function send() within custom button in form.addbutton('submit','submit', send(form)); running when page loaded. because of this, no data being sent send() function , therefore not being handled properly.

from understand, problem has original post request rendering suitelet , interfering post request want send. need separate or differentiate post request renders form 1 sends form. ideal have done in user event script forms can used in suitelets in ss1.0...

is there way possible? should use suitescript 2.0 achieve this? below how code looks:

function main(request, response){         var form = nlapicreateform('submission form');         form.addfield('one', 'text', 'field 1');         response.writepage(form);         form.addbutton('submit','submit', send(form));       }  function send(form){ process form data somewhere... } 

when doing send(form) on suitelet running function. form.addbutton method 3rd parameter accepts string, want like

form.addbutton('submit','submit', "alert('sending form')")

you can add whole stringified function if want build own post, although think easier include form.addsubmitbutton(label) , sends form data same suitelet , there can send data post using nlapirequesturl


Comments

Popular posts from this blog

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -

php - Autoloader issue not returning Class -