Jump to content

textarea when you choice from option


divinedesigns1
 Share

Recommended Posts

hey guys whats good? i have a question, how do i make a textarea to appear when you click a certain button in a contact form? this is my options <select name="services" id="services"><option>footer</option><option>neck</option><option>knee</option><option>eyes</option><option>lips</option></select> so if you click on lips a textarea would appear, how do i do this? i know it have to do with something in php i think it call on the textarea when you click on lips 0.o can i have a few hint or tips?

  • Like 1
Link to comment
Share on other sites

you need to use js. you can bound a onchange event in select and check its value when event trigger if it matches lips either you need to create a node of textarea using js dom or you can have a existed hidden textarea and you need to have visible.

Link to comment
Share on other sites

IF you want textarea to appear with PHP only, you would use a form to send by method get or post, a value of 'lips' on submission to look for submitted value, and show required textarea, BUT! this will mean the reloading of this page completely OR transferring to a different page. Javascript can on selection, show a premade textarea hidden from view using display: none; that would show itself by resetting to display: block; no reload, but javascript must be enabled Ajax same as above, but retrieve texarea PLUS content from database using PHP and javascript combined again no reload, but javascript must be enabled

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...