Re: How to check if form submission succeeded using JavaScript?

2011-04-14 Thread Alec Swan
Thanks. I will follow yours and Pedro's recommendations and submit form using AjaxButton. On Thu, Apr 14, 2011 at 12:54 PM, Martin Grigorov wrote: > if you use (JavaScript) form.submit() then this will reload the whole page. > I.e. there is no way to do anything with JavaScript after submitting t

Re: How to check if form submission succeeded using JavaScript?

2011-04-14 Thread Martin Grigorov
if you use (JavaScript) form.submit() then this will reload the whole page. I.e. there is no way to do anything with JavaScript after submitting the form. On Thu, Apr 14, 2011 at 6:25 PM, Alec Swan wrote: > Hello, > > I have a button on a page which submits a Wicket form by calling > form.submit

Re: How to check if form submission succeeded using JavaScript?

2011-04-14 Thread Alec Swan
Thanks for the prompt response. However, in my case is has to be set on the client/JavaScript side because our application allows page designers to change the content of the page and its behavior at runtime and decide which cookie to set if any. Thanks, Alec On Thu, Apr 14, 2011 at 10:37 AM, Ped

Re: How to check if form submission succeeded using JavaScript?

2011-04-14 Thread Pedro Santos
Hi, you can set a cookie in the Button#onSubmit implementation, new Button(""){ public void onSubmit() { //at this point all validations are tested ((WebResponse)RequestCycle.get().getResponse()).addCookie(new Cookie(name, value)); } } On Thu, Apr 14, 2011 at 1:25 PM, Alec

How to check if form submission succeeded using JavaScript?

2011-04-14 Thread Alec Swan
Hello, I have a button on a page which submits a Wicket form by calling form.submit() using straight JavaScript. If the form submitted without errors, then the JavaScript code should set a cookie. I am looking for some ideas on how to detect if the form was submitted successfully or not in JavaScr