Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after onValidationComplete need double click for form submit #621

Closed
ghost opened this issue Feb 21, 2013 · 5 comments
Closed

after onValidationComplete need double click for form submit #621

ghost opened this issue Feb 21, 2013 · 5 comments

Comments

@ghost
Copy link

ghost commented Feb 21, 2013

need to open the result in the form popup, but always have to click two times on the submit button, I have no idea what is happening.

$(document).ready(function()
{
$("#relatorio").validationEngine('attach',{
onValidationComplete: function(form, status){
if (status == true) {
$("#relatorio").validationEngine('detach');
$("#relatorio").submitData();
}
}
});

$.fn.submitData = function() {      
    $("#relatorio").submit(function() {
        window.open('', 'formpopup', 'width=1024,height=580,resizeable,scrollbars');
        this.target = 'formpopup';
    });
}

});

@TroyWitthoeft
Copy link

Are you using any AJAX validation?

@ghost
Copy link
Author

ghost commented Feb 22, 2013

not , my form
form action="" method="post" name="relatorio" id="relatorio"
table width="100%" border="0" cellspacing="0" cellpadding="0"
tr
td width="90" align="right">Nro Laudo : /td
td align="left">
input name="Numlaudo" type="text" id="Numlaudo" value="" maxlength="10" size="10"
/td>
td width="90" align="right">Vistoriador :
td align="left">
input name="Vistoriador" type="text" id="Vistoriador" value="" maxlength="10" size="10" >
/ tr>
/ta ble>
input name="Pesquisar" type="submit" class="submit" value="Pesquisar">
/f orm>

@ghost ghost closed this as completed Feb 22, 2013
@ghost ghost reopened this Feb 22, 2013
@TroyWitthoeft
Copy link

I see a pattern. You're not using AJAX, but is this issue the same as #544? Looking back there may be a possible fix with this comment
#502 (comment)

Also, read my comment in #594 for a better explanation of what I think is happening. Would you be willing to try something? Check around line 693 inside of validationEngine.jquery.js for the code that says

// If we have a string, that means that we have an error, so add it to the error message.
                if (typeof errorMsg == 'string') {
                    promptText += errorMsg + '
'; options.isError = true; field_errors++;

Comment the above code out. Does that get rid of the double-click requirement?

@ghost
Copy link
Author

ghost commented Feb 22, 2013

I commented, keeps asking two clicks

@posabsolute
Copy link
Owner

Im not quite sure why you want ro resubmit your data, when you validate your data you are already submitting, onValidationComplete stop the default behavior so you can handle the data yourself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants