html - Getting the value of a select tag without the help of post or get method using php -


i'm making project in need pass value of select tag 1 page through url. problem cant value of select tag dynamically. mean know how value $_post['select_tag_name'] don't wanna apply functionality because requires submit button. hoping find way value dynamically(without of form submission). know can submitting form , pass value through header. or setting action next page, don't wanna that. hope makes sense you.thanks , time in advance.

use jquery,

on change of select element, or on click of other element, can redirect form.

<script> $("#select_tag_name").change(function(){   var val = $(this).val();   window.location.href = 'your-php-page.php?drop_down='+val; }); </script> 

note:

1) can use event on element. change() event listed here example.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -