...

View Full Version : Forms Help!



Ben@WEBProp
07-17-2003, 07:16 PM
I am nearing the completion of my site, but I need help with just one more thing!

I have a form that needs to be sent to different people depending on the choice made by the user in a drop-down box. How would I do this? I'm not sure what I need as far as exact code...so does anyone have any ideas?:confused:

Lemme know if you need to see a working example!

Thanks!

-Ben

jalarie
07-17-2003, 07:40 PM
&nbsp;<form&nbsp;method="post"&nbsp;target="_blank"&nbsp;action=""&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enctype="text/plain"&nbsp;onsubmit="return&nbsp;CheckIt()">
&nbsp;&nbsp;&nbsp;<select&nbsp;name="Sel1">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<option&nbsp;value="jalarie@umich.edu">Me</option>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<option&nbsp;value="jalarie@umflint.edu">Myself</option>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<option&nbsp;value="jalarie@flint.umich.edu">I</option>
&nbsp;&nbsp;&nbsp;</select>
&nbsp;&nbsp;&nbsp;<br&nbsp;/>
&nbsp;&nbsp;&nbsp;<textarea&nbsp;cols="40"&nbsp;rows="5"&nbsp;name="Message"></textarea>
&nbsp;&nbsp;&nbsp;<br&nbsp;/>
&nbsp;&nbsp;&nbsp;<input&nbsp;type="submit"&nbsp;value="&nbsp;Submit&nbsp;"&nbsp;title="&nbsp;Submit&nbsp;"&nbsp;/>&nbsp;
&nbsp;&nbsp;&nbsp;<input&nbsp;type="reset"&nbsp;value="&nbsp;Reset&nbsp;"&nbsp;title="&nbsp;Reset&nbsp;"&nbsp;/>
&nbsp;</form>
&nbsp;<script&nbsp;type="text/javascript">
&nbsp;&nbsp;&nbsp;<!--&nbsp;Hide&nbsp;this&nbsp;code&nbsp;from&nbsp;non-JavaScript&nbsp;browsers
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;CheckIt()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;f1=document.forms[0];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;abbreviation
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S1I=f1.Sel1.selectedIndex;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;select&nbsp;index
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S1T=f1.Sel1.options[S1I].text;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;...on-screen&nbsp;text
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S1V=f1.Sel1.options[S1I].value;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;...embedded&nbsp;value
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;f1.action='mailto:'+S1V;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;//&nbsp;End&nbsp;hiding&nbsp;-->
&nbsp;</script>

Ben@WEBProp
07-17-2003, 11:37 PM
:( :( :(

It's still not working...no matter what the crunk I do!
Please take a look at my source code to so what the matter is anyone! Go to http://www.webpropertiesinc.com and follow the nav bar to Forms>Potential Tenants>Commercial and click there. The page that loads is the one that I am talking about!
Please help! I'm so confused!:confused: :eek: :( :eek: :confused:

jalarie
07-18-2003, 02:07 PM
There is no navbar. The only code on the page is:

<html>

<head>
<meta&nbsp;http-equiv="Content-Type"&nbsp;content="text/html;&nbsp;charset=windows-1252">
<meta&nbsp;http-equiv="Content-Language"&nbsp;content="en-us">
<title>Home&nbsp;Page</title>
<meta&nbsp;name="GENERATOR"&nbsp;content="Microsoft&nbsp;FrontPage&nbsp;4.0">
<meta&nbsp;name="ProgId"&nbsp;content="FrontPage.Editor.Document">
</head>

<body>
<p&nbsp;align="center">&nbsp;</p>
<p&nbsp;align="center">&nbsp;</p>
<p&nbsp;align="center"><b><font&nbsp;face="Verdana"&nbsp;size="5">WEB&nbsp;Properties,&nbsp;Inc.com&nbsp;</font></b></p>
<p&nbsp;align="center">&nbsp;</p>
<p&nbsp;align="center">&nbsp;</p>
<p&nbsp;align="center"><img&nbsp;border="0"&nbsp;src="WebPropertiesColor_logo_.gif"&nbsp;width="204"&nbsp;height="71"></p>
<p&nbsp;align="center">&nbsp;</p>
<p&nbsp;align="center">&nbsp;</p>
<p&nbsp;align="center"><font&nbsp;face="Verdana"&nbsp;size="5"><b>Will&nbsp;be&nbsp;up&nbsp;soon...</b></font></p>
</body>

</html>

Ben@WEBProp
07-18-2003, 05:16 PM
Oh, then your last post was probably past 5:00 PST...I have to take the site down after 5 every day before I do a final publish. Right now, I just publish daily for testing and help with stuff. It should be up now!

Sorry about that one!

-Ben

jalarie
07-18-2003, 05:28 PM
Yes, I see it now. You've done a nice job.

You'll need to execute the CheckIt function as well as the FrontPage_Form1_Validator function when the form is submitted. The easiest way is to change the last line at the end of the FrontPage_Form1_Validator function to:

&nbsp;return CheckIt();

Ben@WEBProp
07-18-2003, 05:50 PM
Please bear with me, I am still trying to wake up this morning:D

So lemme see if I got this:
I have to run both the FronPage Validator and the CheckIt() at the same time, right? Ok then,

"change the last line at the end of the FrontPage_Form1_Validator function to:

return CheckIt();"

Is the line that you want me to change
onSubmit="return FrontPage_form1_Validator(this)"
into
onSubmit="return FrontPage_Form1_Validator(this) return CheckIt"
?

where exactly am I supposed to put the return CheckIt? Which lines am I supposed to replace?


Oh yes, and thanks for the compliment...I want to eventually do pure css, xhtml, and Flash...but that is a ways away:o ...

-Ben

jalarie
07-18-2003, 06:00 PM
You seem to be using FrontPage <opinion type="personal" content="yuck!" action="ignore"> to work on your site. You will probably have to switch to a text editor like notepad to do this. Find the beginning of your form, back up about six lines to the "return (true);" line, and replace it with "return CheckIt();" without quotes.

Ben@WEBProp
07-18-2003, 06:35 PM
I see exactly where you mean to insert the code! I think I'm getting this! The only problem is the sadist FrontPage Hussein keeps changing the code that I change when it publishes my page! I don't know how to upload it to my server anyother way...do you know a way around it?

Thanks for all your awesome help!

-Ben:thumbsup:

jalarie
07-18-2003, 06:54 PM
Yes, don't use FrontPage.

How about a direct FTP to upload it?

Ben@WEBProp
07-18-2003, 10:30 PM
That is what I do with FrontPage, and it is the only way I know how to do it. How do I do a direct FTP? (Forgive me if I sound ignorant, but I am a newb. Pretty much all of my 150+ posts have been questions, save for about 30 in which i have offered opinions and helped out on a few things...)

Thanks! You are the first person who actually has had a clue about what to do in this situation!

-Ben

jalarie
07-23-2003, 02:01 PM
Please forgive the slowness of this response; I've been off on vacation.

How about reversing the two functions? Code the "form" tag to "return CheckIt();" and change the "CheckIt" function to run the other one.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum