views:

33

answers:

3

I have a .NET powered website, that has a sign-up box form already. I'm using the JQuery dialog to popup a window, on which I also have a form. That form will not submit using a standard submit button. Nothing happens.

I use the following Javascript to allow my main page signup form to work properly:

 <input onclick="this.form.action='http://domain.com/post.tml';
 this.form.method='post';this.form.enctype='multipart/form-data';this.form.submit();"
 type="image" src="/images/ui/btn-getfreereport.gif" alt="Signup" /> 

I tried using the same code for this popup form, but when you click the submit button, it instead uses the above code for the form that's on the actual site.

How do I focus the Javascript to submit one form instead of the other? Or is there an easier way to get this form to be submitted?

Thank you.

A: 
document.myform.submit();

give your formname

zod
I get the error "Uncaught TypeError: Cannot set property 'action' of undefined" when trying that. I've set the form name using <form id="formName" name="formName">. Am I missing something else?
Jon
so what yu did document.formName.submit();
zod
A: 

Use jQuery to submit the form:

$('.submit-form-button').click(function(){
    $("#myformID").submit();
});
woodscreative
Unfortunately nothing happens when I try this. I can see the event fire, but no response (or error). Probably the same reason just using the standard form submit doesn't work.
Jon
Mmm. You say your pop-up is generated using Jquery, is the form generated on the fly or is it already embedded in your DOM?
woodscreative
A: 

Turns out I just needed to add tags to each form. Visual Studio.NET complains about this as an error, but everything seems to work fine, including this new popup form.

Jon