I have the below script:
<script type="text/javascript">
function get(row){
alert(row);
$.post ('getpeopleinjobs.php',{
postvarposition: form.position1.value,
postvarjob: form.job1.value,
postvarperson: form.person1.value,
postrow: row},
function(output){
$('#training'+row).html(output).show();
});
}
</script>
This works 100%. However I want the ‘1’ or number appended to position, job and person to be the variable ‘row’. something like the below(which does not work)
postvarposition: form.position+row.value
i did try form[position+row].value as per advice from another post but this does not work.
The alert(row) returns 1 if the onchange=”get(1)” and 2 if the onchange=”get(2)” etc so this is working.
How can I concatenate the row variable onto the positon, job, and person statement so that as row increases in value I’ll get
form.position1.value
form.position2.value
form.position3.value etc etc.
Thanks in advance.
Access the form values by string