开发者

In struts 2.0.14 the component <s:reset> button is not working after submitting the page?

开发者 https://www.devze.com 2023-02-10 02:11 出处:网络
I am using Struts2.0.14 for my application. I have abutton to clear the textboxes. I have a few boxes which are stateful and values are persistent after the form is submitted.

I am using Struts2.0.14 for my application. I have a button to clear the textboxes. I have a few boxes which are stateful and values are persistent after the form is submitted.

My problem is that when I press the button before submitting the form it clears all values from the textboxes. But when I submit the form and press reset again, t开发者_JAVA百科he textboxes do not reset.


I'm not sure if this is your problem, but: to "reset" the fields of an HTML form is not the same as to "clear" them, it just means to reset their values to their "default" values, those that were set (typically) in the value="..." attribute of the field tag.

Now, consider the typical server-side form validation workflow, when the user has entered some field values, submited the form, and get it back from the server with some errors marked (typically in Struts2, this corresponds to the INPUT result). Here, the new HTML page that is returned to the user will have its form fields filled with the previously submitted values. Now, from the client side perspective, those are the "default" values of the form: if you "reset" the form (perhaps after editing it), those are the values that will be restored.

0

精彩评论

暂无评论...
验证码 换一张
取 消