I am brand new to jquery and trying to modify a basic script from php academy.
the jquery script is:
<script type="text/javascript">
function get() {
$.post('getpeopleinjobs.php', {
postvarfname: form.firstname.value,
postvarlname: form.d = surname.value
}, function(output) {
$('#age').html(output).show();
});
}
</script>
and my form code is:
<form name="form">
<input type="text" id="firstname">
<input type="text" id="surname">
<input type="button" value="get" onclick="get();">
</form>
This worked perfectly when I was passing just one variable and my code snippet was:
$.post('getpeopleinjobs.php', {
postvarfname: form.firstname.value
}
I then tried to add a second variable with
$.post('getpeopleinjobs.php', {
postvarfname: form.firstname.value,
postvarlname: form.d = surname.value
}
It does not work now in Internet Explorer but interestingly enough it does work in Chrome?
Any advice for the beginner?=
d=sitting in the second value? So, it should read$.post ('getpeopleinjobs.php',{postvarfname: form.firstname.value,postvarlname: form.surname.value}