I have a page with a simple form:

<form wicket:id="firstForm">
    <input type="text" wicket:id="textField" />
    ...
    <a wicket:id="selector">select objects...</a>
    <div wicket:id="popup"></div>
    ...
    <button type="submit">Submit</button>
</form>

When "selector" link is clicked a ModalWindow (attached to "popup" id
in markup) is shown with a content panel containing another form
("secondForm"). In the real example this "selector" link and
modalwindow "popup" are wrapped into one component, that's why this
"popup" is defined inside a firstForm.
So this secondForm is nested inside the firstForm. On secondForm there
is an AjaxButton component:

        <form wicket:id="secondForm">
                <input wicket:id="searchText" type="text" />
                <button wicket:id="submit" type="submit" 
class="toolButton">Search</button>
        </form>

That secondForm works fine. But after I close ModalWindow and I am
trying to submit firstForm (by pressing ENTER key in "textField"
input), the secondForm's AjaxButton onSubmit() method is called. I
think this is because the modal window content still exists inside a
DOM, so the browser tries to submit firstForm using the first found
submit button (which is a button from the secondForm). I hope this is
clear enough ;).

How to prevent from submiting the firstForm by AjaxButton from the
nested secondForm? Maybe modal window content markup should be removed
from DOM after close?

--
Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to