?
Solved

Adding recipient drop down menu to a simple form processor?

Posted on 2003-03-20
10
Medium Priority
?
231 Views
Last Modified: 2012-05-04
I am trying to add a simple drop down menu to my contact page that will allow the user to select a recipient before they enter their message rather then have it sent to a pre-defined user.

Is there a simple (free) form processor somewhere that does this or is the code easy enough for someone to punch up here?

Much appreciated!

rob
0
Comment
Question by:rkingsbury
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 15

Expert Comment

by:VGR
ID: 8175126
very easy

just drop in your FORM something like this :

<SELECT NAME=selectname SIZE=1>
<OPTION VALUE=1>text for value 1
<OPTION VALUE=2>text for value 2
<OPTION VALUE=3>text for value 3
</SELECT>

and you are done
0
 

Author Comment

by:rkingsbury
ID: 8175284
Let me clarify..
I have a form processor.
I have multiple recipients.
How do I like the two using a simple dropdown menu. I'm pretty sure it's going to have something to do with arrays and variables rather then straight up HTML :)

Thanks for the quick reply though.
0
 
LVL 15

Accepted Solution

by:
VGR earned 200 total points
ID: 8175643
in PHP, yes, but as "you have a form processor" (sic)(1), search in its documentation :/

(1) mine is wordpad

something like this may help you :
It's for selecting a recipient in a "private message" of my forum.

Just adapt to your DB layout, change pseudo for email address field, and you're done [ie : I leave you some work to do, provided you did not at all give a lot of details on the first place :D ]

<?
echo "<SELECT name=destinataire>"; // ni multiple ni size=
$linkID=mysql_connect("$dbHost","$dbLogin","$dbPassword") or die ("bad connect".mysql_error());
mysql_select_db($dbName,$linkID) or die ("bad select DB ".mysql_error());
$query="select * from $dbTableUsers order by pseudo asc;";
$result=mysql_query($query,$linkID) or die ("bad query sel users ".mysql_error());
while ($res=mysql_fetch_array($result)) {
  echo "<option value=\"".$res["pseudo"]."\"".(($dest==$res["pseudo"])?" SELECTED":"").">".$res["pseudo"]."</option>";
} // affichage
echo"</select>";
?>
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:rkingsbury
ID: 8175752
Thanks.

0
 
LVL 15

Expert Comment

by:VGR
ID: 8175852
I will ask for the grade to be changed from "C" to any other value.
I don't appreciate this, given you thank me and I gave the "code answer" that you requested.
see you later
0
 

Author Comment

by:rkingsbury
ID: 8177321
Jeez buddy relax, I didn't know you were gonna whine about it or I'd have sent you some roses too..

Look, I gave you a C because you started out with a piece of HTML dropdown code that was totally not what I needed and then when I asked for a few more details on how to hard code a few recipients in, you gave me a big SQL deal. Sure, it may work good and all, but it's not at all what I needed: major overkill. I needed something completely different then you were offering and so I down-graded you. Big deal - that's life. You don't cry about it..

So anyway, if you want, I'll go in and give you an A even though you really didn't give me the answer I needed. Let me know if that's what you want and I'll go ahead and give you the stupid points you apparently desperately need.

rob
0
 
LVL 15

Expert Comment

by:VGR
ID: 8177618
you're totally wrong in almost everything you wrote in the last message :D

"I am trying to add a ***simple*** drop down menu to my contact page that will allow the user to select a recipient before they enter their message rather then have it sent to a pre-defined user." (emphasis is mine)
--> simple asked, simple given
Moreover, you reiterate above that you asked "how to hard code a few recipients in" AND I PROVIDED THE HTML CODE NECESSARY AND SUFFICIENT TO HARDCODE SOME RECIPIENTS. Did I not ?

"Is there [...] or is the code easy enough for someone to punch up here?"
--> "code" was imprecise. I gave you HTML code. Then I gave you PHP code. You call those pityful 9 lines of PHP doing a loop for OPTIONs 'a big SQL deal', well it's your problem man :D
"major overkill" for a simple "for" loop that one way or an other you'll need to "code" your loop : maximal fun here reading you.

c'est bon de rire quelquefois 8-)


PS don't woeey about cries, points or grades, but learn to express yourself in such a way people wil not "propose solutions that are not what you needed"

especially when you ask for "trying to add a simple drop down menu to my contact page [...] how to hard code a few recipients in" and you get the relevant (HTML) code ;-)
0
 
LVL 15

Expert Comment

by:VGR
ID: 8177632
PPS : I love you too ;-)
0
 
LVL 1

Expert Comment

by:Computer101
ID: 8177674
Grade changed as requested

Computer101
E-E Admin
0
 

Author Comment

by:rkingsbury
ID: 8177834
Ok, well, whatever.

Like I said..

Thanks.
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question