I'm trying to work on how to append some more values to the serialize method in JQuery.
snippet
//
var dataString = $("#myform").serialize();
dataString.push({name:"type", value: "myvalue"});
//
On passing the values to ajax call page
I am using this additional data for my conditional check as
if ( $_POST['type'] == 'myvalue')
{
// on success code
}
else
{
//On fail Code
}
But the condition is always going to else but now in if condition, Please assist If I am missing something and taking it wrong.
**NOTE the code is working fine if I am passing this name and value as hidden field form form ...