Skip to content

Add hideMessage method #2

@bolollo

Description

@bolollo

When validating a form if everything is correct is useful to have a hideMessage method to hide the error message.

Example of use
function leaveAStepCallback(obj){
console.debug("leaveAStepCallback");
var valid = false;
var step_num= obj.attr('rel'); // get the current step number
console.debug(step_num);
if (step_num == 1){
if ($j('#idCapaGeom').val() != ""){
$j('#wizard').smartWizard('setError',{stepnum:1,iserror:false});
$j('#wizard').smartWizard('hideMessage');
return true;
}else{
$j('#wizard').smartWizard('setError',{stepnum:1,iserror:true});
$j('#wizard').smartWizard('showMessage','you mesage');
}
}
return valid;
}

//may be this patch can help

// Method calling logic
if (!action || action === 'init' || typeof action === 'object') {
init();
}else if (action === 'showMessage') {
//showMessage(Array.prototype.slice.call( args, 1 ));
var ar = Array.prototype.slice.call( args, 1 );
showMessage(ar[0]);
return true;
}else if (action === 'hideMessage') {
hideMessage();
return true;
}else if (action === 'setError') {
var ar = Array.prototype.slice.call( args, 1 );
setError(ar[0].stepnum,ar[0].iserror);
return true;
} else {
$.error( 'Method ' + action + ' does not exist' );
}

//line 304 after the showMessage function
function hideMessage(){
msgBox.hide();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions