g_form.setValue onSubmit client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 11:38 AM
Hi
I am trying to set values of the field on submit with the response which i get from my SOAP call and i am able to see that in alert.
but i am not able to set that to my string fields can you please let me know what am i doing wrong in below statement.
function onSubmit()
{
pdetail = *******************
alert(pdetail);
g_form.setValue('pallete_detail', pdetail);
g_form.setValue('palletesource', "pdetail");
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 11:48 AM
Yes it should. Is this on catalog item? What is the type of your variables "'pallete_detai" and "palletesource"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 11:49 AM
it's string

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 12:00 PM
There is a syntax error. You are using quotes fro pdetail on the second setValue(). remove the quotes as shown below
function onSubmit()
{
pdetail = *******************
alert(pdetail);
g_form.setValue('pallete_detail', pdetail);
g_form.setValue('palletesource', pdetail);
}