I simply don't understand JavaScript one bit.
I made a small script in PHP and now i have to create the same script in javascript.
So I have a small form and when the form is submitted I want the value entered into the field to be sent to a function as a variable
$(document).ready(function() {
$("form").submit(function(){
var enteredValue=$('input[name="x"]').value;
grabvalue(enteredValue);
});
});
function grabvalue(value)
{
alert(value);
}
but this doesn't work played with it and all I can get is either [object Object] or undefined
What am I doing wrong?