Hi,

I am working on a CMS project that is within a Spring/Velocity
framework. I have a form that calls some information from a page to be
edited. When the fields are edited, the user will click on a save
button, which calls up the ui dialog box, asking if they are sure they
want to save. In this dialog box, I have the submit button for the
form.

This form works by sending the name element from the submit button to
a java page controller, which then saves the information back to the
file that was to be edited, and the whole page is then reloaded.

My problem is however that although the submit button works, and
reloads the page, the name element is not submitted and therefore the
file is not changed and saved.

Here is part of the code:

<form id="edit" method="post" action="editpage.html">      //ie the
same page that is now open
<div>
   * some elements of form that are editable*
</div>
<div id="buttons">
<a href="#" id="saves"><img src="#springTheme('save')" alt="Spara/
publisera" style="margin-bottom: 20px"/></a>      //This is the button
that calls the popup dialog
</div>
<!-- hidden div -->

                                <div id="sureSave"  style="padding: 0px">
                                        <p style="padding: 1.5em 1.7em;">Are 
you sure you want to publish
your changes?</p>
                                        <div class="ui-dialog-buttonpane" 
style="position: absolute;
bottom: 0px; display: block">
                                         <input type="button" class="button" 
id="close1" value="Cancel" /
>
                                         <input type="submit" class="button" 
name="save" id="saved"
value="Save">
                                        </div>
                                </div>

                        </form>

In my javascript I have:

$(document).ready( function() {

(blaa blaa blaa)

               $("#close1").click( function() {
                        $("#sureSave").dialog('close');
                });

                $("#saved").click( function() {
                                $("#edit")[0].submit();

                });


Now, when I didn't have the submit/save button in the hidden popup
div, it worked fine. But as soon as I  moved it into the hidden div,
it needed the javascript to cause it to trigger, and all it does it
cause the form with the id edit to trigger, refreshing the page but
not sending the 'name' element of the submit button to the Java
controller (name="save"). Thus the changes to the fileds are not
saved.

So my question after all this is, how do I get the .submit() function
to send the 'name' value of the submit button too? (As automatically
happens when the button isn't in a hidden dialog box)

Thank you for your quick relpy :)

Love
Rebecca

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to