I’m using jquery form plugin. and this is my sample form
<form id='formId' action='<?php echo $_SERVER['PHP_SELF']l?>' method='POST'>
<input type='text' name='username'/>
</form>
And this my Javascript
$('#formId').ajaxForm({
success:function(data){
console.log(data)
}
})
In this case i want to pass another data value dynamically without implement it in HTML. For example i want to pass the password field. Is there any method to implement this option?
From This Page, the
beforeSubmitfunction allows you to hook into the form data submitted and inject / modify data.It allows for 3 arguments, the form presented as an array(this means we can push into it), the form presented as a jquery Object (for serialization), and options object that you use with ajaxForm/ajaxSubmit. Working example ->