Reputation: 73
I have created dropdown menu "Users", whith 2 options to select
<select name="Users">
<option>User1</option>
<option>User2</option>
</select>
I'm stuck with next thing i want to do, which is: -if user1 is selected, another dropdown menu is generated -if user2 is selected, input windows is generated
I would like changes to be made without submit button. Changes should be made with selection on "users" dropdown menu.
Any tips or solution will be greatly appreciated!
Upvotes: 0
Views: 136
Reputation: 4064
<select name="Users" onchange="this.form.submit();">
<option>User1</option>
<option>User2</option>
</select>
Upvotes: 0
Reputation: 548
you should use jQuery events and use change event of select box to show and hide any html elements you want.
Upvotes: 0
Reputation: 4676
You need Javascript http://www.w3schools.com/js/default.asp
PHP is server side language and it generates code only while user is loading the page not after its already loaded. If you want users to get code inside their browser, after some their action you need User side language as Javascript.
It will be easier for you if you use some Javascript library as jQuery http://www.jquery.com .
Upvotes: 2