Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using the selected value of a drop down before form submission

i am using a dropdown in php which asks for user_category before creating the user. Upon selection of the category further text boxes are to be created dynamically depending upon the selection. I know how to get the selected value from $_POST but here i need it befor form submission.Pls help

like image 909
Abhishek Avatar asked Oct 15 '25 14:10

Abhishek


1 Answers

You would need to use js. Either:

document.getElementById('elementName').value

or

document.formName.elementName.value

or

use jQuery.

Than if you need a response from a php script before submission you would need to use ajax.

like image 81
Babiker Avatar answered Oct 18 '25 07:10

Babiker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!