MockY Posted July 18, 2007 Share Posted July 18, 2007 I have made a Mail form where the user chooses who he/she is from a drop down list, and depending on their choice, their email signature should appear in the <textarea>. How is that possible with PHP? Is it even possible, or do I have to use Java? Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 18, 2007 Share Posted July 18, 2007 <textarea name="" cols="" rows=""><?=$value?></textarea> is that what you mean if you mean when the user change the value of select then something must happen you will need ajax but this can be done in php Quote Link to comment Share on other sites More sharing options...
MockY Posted July 18, 2007 Author Share Posted July 18, 2007 This is what I mean: <select name="from"> <option value="none">Who Are You?</option> <option value="Mary <mary@mail.com>">Mary</option> <option value="Ryan <ryan@mail.com">Ryan</option> <option value="Sam <sam@mail.com">Sam</option> </select> Now, let say Ryan enters the site and he wants to mail a specific person. So he selects his name. When that selection is made, his signature should automatically appear in the <textarea>. And I wonder if this is possible somehow in PHP. If now, could you point me in the right direction (Ajax or something similar) Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 18, 2007 Share Posted July 18, 2007 java script is the answer then u have to use the onchange="the function()" property of select option Quote Link to comment Share on other sites More sharing options...
MockY Posted July 18, 2007 Author Share Posted July 18, 2007 I have been looking around, and can't say that Java is my strength. I found some what an example that might work here http://www.java2s.com/Code/JavaScriptReference/Event-Handlers-Reference/onChangeExample.htm but I don't understand where to put the three different events that will happen once it is selected. Could yu help or point me in the right direction on some site? All help is appreciated, thank you. Quote Link to comment Share on other sites More sharing options...
dbillings Posted July 18, 2007 Share Posted July 18, 2007 http://w3schools.com/ajax/default.asp Quote Link to comment Share on other sites More sharing options...
ryeman98 Posted July 18, 2007 Share Posted July 18, 2007 I have been looking around, and can't say that Java is my strength. I found some what an example that might work here http://www.java2s.com/Code/JavaScriptReference/Event-Handlers-Reference/onChangeExample.htm but I don't understand where to put the three different events that will happen once it is selected. Could yu help or point me in the right direction on some site? All help is appreciated, thank you. You have to stop saying Java. Java and Javascript are two completely different languages! Just a heads up 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.