开发者

PHP, Javascript, HTML

开发者 https://www.devze.com 2022-12-22 12:14 出处:网络
How to get option value in PHP? And i want to redirect to the same page, if option is changed by using onClick() function.

How to get option value in PHP? And i want to redirect to the same page, if option is changed by using onClick() function. Anybod开发者_高级运维y please help me.


Javascript :

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


.......

<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'];
0

精彩评论

暂无评论...
验证码 换一张
取 消