Incredinot Posted December 1, 2009 Share Posted December 1, 2009 Hi.. Alright - so i have this form written in php and html - but i have one place where i would like some ajax. The scenario is - if user is "a" he dont need to fill a text field, but if he is "b" then he needs to. So is it possible to make something like: <select name="something"> <option value="1">1</option> <option value="2">2</option> </select> <!--- If the chosen option is "1" - then it should do nothing. If its option 2, i should make something like: <input type="text" name="something"> !--> And im pretty blank regarding ajax. Just bought membership at lynda a while ago, so im looking further into it within short time.. But within that time, could someone help me out maybe? Quote Link to comment Share on other sites More sharing options...
Incredinot Posted December 1, 2009 Author Share Posted December 1, 2009 Forgot to mention that its fatal that it works with ie6 etc... Sadly many people still uses this.. Dont know why... But anyway - need it to work with ie6 aswell. Quote Link to comment Share on other sites More sharing options...
JustLikeIcarus Posted December 3, 2009 Share Posted December 3, 2009 Well using jQuery it would be something like $('#id_of_select').change(function(){ if($(this).val() == 2){ $(this).insertAfter('<input type="text" name="somethingElse">'); } }); Thats just off the top of my head but i think its what you want. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.