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? Link to comment https://forums.phpfreaks.com/topic/60465-how-to-make-drop-down-selection-to-effect-other-types-of-fields/ 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 Link to comment https://forums.phpfreaks.com/topic/60465-how-to-make-drop-down-selection-to-effect-other-types-of-fields/#findComment-300772 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 <[email protected]>">Mary</option> <option value="Ryan <[email protected]">Ryan</option> <option value="Sam <[email protected]">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) Link to comment https://forums.phpfreaks.com/topic/60465-how-to-make-drop-down-selection-to-effect-other-types-of-fields/#findComment-300777 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 Link to comment https://forums.phpfreaks.com/topic/60465-how-to-make-drop-down-selection-to-effect-other-types-of-fields/#findComment-300780 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. Link to comment https://forums.phpfreaks.com/topic/60465-how-to-make-drop-down-selection-to-effect-other-types-of-fields/#findComment-300795 Share on other sites More sharing options...
dbillings Posted July 18, 2007 Share Posted July 18, 2007 http://w3schools.com/ajax/default.asp Link to comment https://forums.phpfreaks.com/topic/60465-how-to-make-drop-down-selection-to-effect-other-types-of-fields/#findComment-300828 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 Link to comment https://forums.phpfreaks.com/topic/60465-how-to-make-drop-down-selection-to-effect-other-types-of-fields/#findComment-300888 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.