?Form? question - what script?

I need to have a form submitted from a web site. I would like the user to select a dealer from a drop down list on the form and click submit. the form will then be sent to the dealer selected. How do I accomplish this?The easiest way would be to just send the form contents itself to the dealers website via: get/ post methods...and action="http://the dealers website"
alternatives:
you could send an email with the contents of the form included to the dealer.

you could store the form info into a database record, and allow dealers to log in and view the data.here is the code for the 'easy' way....Thanks Dr. Web, but I need to clarify a bit. The web site is for a manufacturer. He wants the form to go to the individual dealer which will be responsible for the actual sale. I know how to do what you said, but I want to allow the user to choose the nearest dealer and then have the form automatically send to that dealer.ok....looks like you'll definately need a database for this.

Make a table of delaers names, addresses, phone, email, and so on.

You'll need a page that can hit the database now.
let the user use the select box to select the city....and make it jump to a page that displays the following

in english: display all records that are from this city, and show the dealer name, and address.

in SQL: select * from tableName where city='denver' order by name

alternatively you could populate a select box with the dealer names, and assign the value to a url as I did in my previous example. Then the html page I wrote would work the rest of the magic needed.

Hope this at least gives you another angle on it.I appreciate the help Doc. Can i populate the select box with dealer names and have them linked as an email address. So that when visitor hits send it goes to the email address of the dealer selected?yes, as long as you use mailto: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->

it should work, though I don't like using this method myself, as the emails aren't formatted at all-but its simple, and you may not need fancy formatting here.I have made forms which submit dtat to me via email. using mailto in the action statement. Now i am trying a simple version of pick an address to send to, but not working.

Code:
<form method="POST" enctype="text/plain">

Name <input type="text" name="name" size="20">
Email<input type="text" name="email" size="20">
Dealer: <select size="1" name="dealer">
<option value="mailto:[email protected]">
TheKman</option>
<option value="mailto:[email protected]">
JoMaMa</option>
</select>
<input type="submit" value="Submit" name="submit">
<input type="reset" value="Reset" name="reset">
</form>Maybe i need an action call that will grab the email address associated with the selcted item in the drop down menu?Kman,

OK I modified the first script to submit to emails instead of urls.

try it out...VERY COOL - Thank you Dr. Web! Now I'm gonna get picky. Is there anyway to format the results. I know on a regular emailed form you can use enctype="text/plain" can this be done here as well?The new code:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function validateForm(){
if(window.document.testform.textbox1.value==""){
alert("missing field required!");
window.document.testform.textbox1.focus();
return false;
}else{

if (document.testform.make.selectedIndex == 0) {
alert("Please select a destination");
document.testform.make.focus();
returnStatus = 0;
}else{
where=document.testform.make.value;
document.testform.method="post";
document.testform.action=where;
document.testform.submit();
}}}

// -->
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="testform" ENCTYPE="text/plain">

<SELECT NAME="make">
<OPTION VALUE="" SELECTED>Select One</OPTION>
<OPTION VALUE="mailto:D[email protected]">Dr. Web</OPTION>
<OPTION VALUE="mailto:[email protected]">someone</OPTION>
<OPTION VALUE="mailto:p[email protected]">pixelmonkey</OPTION>
<OPTION VALUE="mailto:[email protected]">jason</OPTION>
</SELECT>
<input type="text" size="15" name="textbox1">
<INPUT TYPE="BUTTON" VALUE="Send form" onClick="validateForm(document.testform)">
</FORM>
</BODY>Thanks whkoh! If I want to add additional fields, do I need to add additional validators in the head?
 
Top