adam84 Posted August 20, 2008 Share Posted August 20, 2008 I want to add a feature to my site, but I have no idea what it is called. So I cannot even google it. What I want is when a user clicks on a certain textfield, I want to populate a menu under the textfield with different things. If the user clicks on one of the options, I want the value of that option to be inserted into the textfield, or if the user do not want any of the options, they can enter type in what they want. Any Ideas? Quote Link to comment https://forums.phpfreaks.com/topic/120565-solved-what-is-this-called/ Share on other sites More sharing options...
akitchin Posted August 20, 2008 Share Posted August 20, 2008 this is called "custom javascript." you'll need to use javascript events to handle when users select something and deselect them, as well as how to add things to the element properties. have a look for the following events: onfocus (selection) onblur (deselection) you may also want to look up how to select and modify certain properties of certain elements. that's basic javascript, and any beginner tutorial to do with forms should be able to help you. Quote Link to comment https://forums.phpfreaks.com/topic/120565-solved-what-is-this-called/#findComment-621289 Share on other sites More sharing options...
haku Posted August 21, 2008 Share Posted August 21, 2008 You want to look into how to manipulate the DOM (document object model) using javascript. If the info you want to be placed in the text field has to come from the database, you want to look into AJAX, which is a method of using javascript to make requests to the server, and then use the response information to change the page it is running on. Quote Link to comment https://forums.phpfreaks.com/topic/120565-solved-what-is-this-called/#findComment-621588 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.