I have the following code that builds a query string:
var name = $(this).next()[0].name;
var value = $(this).next()[0].checked;
var str = name+'&value='+value;
and outputs an array on my server like this:
[value] => false
What I would like to have is something more like this:
array(
[myInputName] => value
)
How can I achieve this?
Just use
var str = name + '=' + value;
What you have would output something like:
myInputName&value=myInputValue
Using name in that way is not useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With