I am using javascript and trying to call another function from a function with passing arguments in $_POST variable of php ! I cant figure Why am I getting null every time.
Here’s the code for the form in javascript
" To " +
"<select name='to'>";
//document.write(arr.length);
for(i=0; i<arr.length; i++)
{
if(arr[i])
txt_bottom += "<option value='" + arr[i] + "'>" + arr[i] + "</option>";
}
txt_bottom+= "</select> <br> <br>" +
"Input : <input type='text' name='input_value' />
<input type='submit' value='Evaluate'
onclick=\"calculate_mesurement('<?php echo isset($_POST["from"])?$_POST["from"]:"nothing"?>', '<?php echo isset($_POST["to"])?>')\"/> <br><br>" +
To make the code clear this is just informative that calculate_measurement accepts two arguments
Any help will be highly appreciated
Are you trying to run
calculate_mesurementusing the values the user just entered intofromandto?$_POSTisn’t set until the form is submitted, you have to use Javascript to get form values prior to submitting.