srilu
01-25-2010, 09:22 PM
Hi,
I need suggestion on how to print the updated form "hidde" field value on JSP screen without refreshing the page.
Currently I'm printing one form hidden field as
<bean:write name="testForm" property="testCounter"/>
Here on pageload I have to check some results based on I have to increment this counter on the fly and display.
here server side I'm using Struts, so My above hidden field/testCounter default value is '0'. Since jsp code loads first when I made changes on onload javascript and tried to print the updated form field value '1' its not printing since JSP serverside code is not effecting, it is loaded already before javascript/cliend side code.
I tried using Ajax I sent request on pageload and updated this "testCounter" value on server side but I'm not able to get the results back immediately with "updated form hidden fild value" to print on the jsp.
When I searched in Google all i found is
- to submit the form using AJAX whithout refreshing the page and getting the results back as simple text printing on the screen as "Thank you for visiting" etc...
Could any one please help me ASAP :confused: to get Ajax response with updated form field values to print on JSP immediately without refreshing the page, or any solution other than AJAX in this case.
Help is greatly appreciated. thank you.
-sri
I need suggestion on how to print the updated form "hidde" field value on JSP screen without refreshing the page.
Currently I'm printing one form hidden field as
<bean:write name="testForm" property="testCounter"/>
Here on pageload I have to check some results based on I have to increment this counter on the fly and display.
here server side I'm using Struts, so My above hidden field/testCounter default value is '0'. Since jsp code loads first when I made changes on onload javascript and tried to print the updated form field value '1' its not printing since JSP serverside code is not effecting, it is loaded already before javascript/cliend side code.
I tried using Ajax I sent request on pageload and updated this "testCounter" value on server side but I'm not able to get the results back immediately with "updated form hidden fild value" to print on the jsp.
When I searched in Google all i found is
- to submit the form using AJAX whithout refreshing the page and getting the results back as simple text printing on the screen as "Thank you for visiting" etc...
Could any one please help me ASAP :confused: to get Ajax response with updated form field values to print on JSP immediately without refreshing the page, or any solution other than AJAX in this case.
Help is greatly appreciated. thank you.
-sri