g_form.setValue onSubmit client Script

n_kishore
Giga Contributor

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");

  }

7 REPLIES 7

Yes it should. Is this on catalog item? What is the type of your variables "'pallete_detai" and "palletesource"?


it's string


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);


  }