jQuery form dialog, submiting to coldfusion page, nothing happens :(
Hey all, my first post, yay!
I have a jquery dialog window that pops up with a form:
- <!--- FORM STARTS HERE --->
<div id="dialog" title="Send Request Form">
<p id="validateTips">All form fields are required.</p>
<div id="contact_form">
<form id="request" method="post" action="#CGI.SCRIPT_NAME#" enctype="multipart/form-data" class="yform columnar">
<fieldset>
<label for="name">Name</label>
<input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all" />
<label for="email">Email</label>
<input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" />
<label for="cell">cell</label>
<input type="cell" name="cell" id="cell" value="" class="text ui-widget-content ui-corner-all" />
<input type="submit" name="sendBTN" value="submit" class="contact_button">
</fieldset>
</form>
</div>
</div>
<!--- REQUEST BUTTON HERE --->
<button id="create-user" class="ui-button ui-state-default ui-corner-all">Request this item</button>
</div>
Then I have the script that I got from the demo on the jquery website:
- $("#dialog").dialog({
bgiframe: true,
autoOpen: false,
height: 600,
width: 500,
modal: true,
buttons: {
'Send Request': function() {
var bValid = true;
allFields.removeClass('ui-state-error');
bValid = bValid && checkLength(name,"username",3,16);
bValid = bValid && checkLength(email,"email",6,80);
bValid = bValid && checkLength(cell,"cell",5,16);
if (bValid) {
$("form").submit(); I DONT KNOW WHAT GOES HERE TO SEND MY FORM :(
//$(this).dialog('close');
}
},
Cancel: function() {
$(this).dialog('close');
}
},
close: function() {
allFields.val('').removeClass('ui-state-error');
}
});
Im really stuck, I've google for hours.
The form submits perfectly if I use the submit button (Pictured)
Can I make it so if someone clicks the "send request" button, it does the validation, then clicks the "submit" button?
