tags:

views:

88

answers:

0

Hi,

I have a GWT app, and need a user login form. I want to let the browser save the username and password for the user. I believe I need to use a 'regular' form for this (not one generated by GWT). So I made a simple form:

<form id="myform">
  <input type="text" name="username">
  <input type="password" name="password">
  <input type="submit" value="Login" />
</form>

now I'd like to interrupt the submission process, grab the username/password, do login via RPC, but have the browser save the contents of those fields for the user, if they want. There are a few posts on the gwt dev boards about it, not sure which one works because none of them are working out of the box for me. I think it should look like:

FormPanel form = FormPanel.wrap(Document.get().getElementById("myform"), false);
form.setAction("javascript:;");
form.addSubmitHandler(new SubmitHandler() {
    public void onSubmit(SubmitEvent event) {
        // Do my RPC call here?
        // User should have been prompted to save password already now?
    }
});

does anyone know how to get this to work?

Thanks