spearchilduser Posted March 22, 2012 Share Posted March 22, 2012 Hi is there a way to populate a textbox with the details selected in a select box in php i basically have a select box and a textbox for the user to select an option they can either select from the drop box or write in text i dont know how if they sleect from the drop box to populate the textbox or say that one or the other has to be filled out i only know how to print a error message to say one needs to be filled out any help at all ?~ Quote Link to comment https://forums.phpfreaks.com/topic/259509-help-please/ Share on other sites More sharing options...
samshel Posted March 22, 2012 Share Posted March 22, 2012 Not sure if this is related to PHP. You can achieve what you want quite easily by using HTML + JS. If you want server side validations then you can use PHP. Quote Link to comment https://forums.phpfreaks.com/topic/259509-help-please/#findComment-1330265 Share on other sites More sharing options...
spearchilduser Posted March 22, 2012 Author Share Posted March 22, 2012 is it possible to add js onto the select box which is populated from a database ? if so then i apologise ive added it to the wrong thread? Quote Link to comment https://forums.phpfreaks.com/topic/259509-help-please/#findComment-1330268 Share on other sites More sharing options...
samshel Posted March 22, 2012 Share Posted March 22, 2012 SELECT box is HTML , you can JS which will will handle the population of text box or do any other action. PHP is a server side language and will provide you data for the drop box, but client side rendering is HTML and JS [if you use it]. Quote Link to comment https://forums.phpfreaks.com/topic/259509-help-please/#findComment-1330269 Share on other sites More sharing options...
spearchilduser Posted March 22, 2012 Author Share Posted March 22, 2012 ok then thank you so ill need to use js on the select box function so its the wrong area of the forum my appologise and thanx for the reply Quote Link to comment https://forums.phpfreaks.com/topic/259509-help-please/#findComment-1330272 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.