Can I send $_POST[] from the onchange of the form to a javascript function like this
<select name="slct" onchange="rohan('measurement_conversion', <?php isset($_POST["slct"])?$_POST["slct"]:"nothing" ?>)">
If no then How can I do this ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It looks like you’re basically trying to set a JavaScript variable by printing it out based on some PHP conditions. You can totally do this, but it looks like you want to pass a string through so you’ll need to wrap it with quotes.
You should also do something to sanitize that value, it’s dangerous to let someone potentially change your HTML by just putting something in the URL.