Page 1 of 1

OnSubmit not sending data back.

Posted: Tue Jun 10, 2014 9:57 am
by mpilo0
Hi,
I seem to be having a problem with the onSubmit event. I am doing some pui.set instructions in the onsubmit because i want these values changed before they are sent back to the server, however it doesn't seem to be submitting back with the correct information back to the server. When i run my program in debug client-side i see the values changed correctly, however when i run it in debug server-side i still have the old values in my RPG is this normal behaviour of the onsubmit or am i doing something wrong?

If it is normal where could i setup the code to change valeus before returning to the server?

Thanks

Re: OnSubmit not sending data back.

Posted: Tue Jun 10, 2014 10:41 am
by dennisw
Not completely sure what you're doing. Rather than use onSubmit you could use onClick. Have the javascript change your data, then use the pui.click() to submit back to the program.

Re: OnSubmit not sending data back.

Posted: Tue Jun 10, 2014 10:48 am
by mpilo0
Problem is there are many things that will submit back to the server and i need it to be set no matter how i return to the server.

Re: OnSubmit not sending data back.

Posted: Tue Jun 10, 2014 3:42 pm
by Scott Klement
Please make sure that the things you are setting are input-capable fields (like text boxes.)

Re: OnSubmit not sending data back.

Posted: Wed Jun 11, 2014 8:59 am
by mpilo0
Yup, they are all hidden textboxes.

Re: OnSubmit not sending data back.

Posted: Wed Jun 11, 2014 4:47 pm
by Scott Klement
I see why this is not working. The response to send back to the server is built before the 'onsubmit' event is fired... so it's too late at that point to set any field values. Sorry, it looks like you'll need to do something like dennisw suggested and set the value at some point earlier in the process. (Maybe set the field when the values it's calculated from are changed?)

Re: OnSubmit not sending data back.

Posted: Thu Jun 12, 2014 8:59 am
by mpilo0
Yea, i just managed to do it and it works but shouldn't the onSubmit logically allow me to do this?