0

How to get option value in PHP? And i want to redirect to the same page, if option is changed by using onClick() function. Anybody please help me.

1

2 Answers 2

1

Javascript :

Use eleement_id.selectedIndex() function , It will give the selected option properties.

Sign up to request clarification or add additional context in comments.

1 Comment

he said "option value" not text of selected option.
1

.......

<select name="select" onchange="document.location.href='this-page-name.php?val=' + this.value">
  options....
</select>

You can get its value like this:

echo $_GET['val'];

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.