Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12

Thread: Forms Help!

  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    Spokane, WA
    Posts
    512
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Forms Help!

    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?

    Lemme know if you need to see a working example!

    Thanks!

    -Ben

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    624
    Thanks
    1
    Thanked 20 Times in 20 Posts
    &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&nb sp;"&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;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;abbreviation
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S1I=f1.Sel1.selectedIndex;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&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>

  • #3
    Regular Coder
    Join Date
    Jun 2003
    Location
    Spokane, WA
    Posts
    512
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy



    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!

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    624
    Thanks
    1
    Thanked 20 Times in 20 Posts
    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>

  • #5
    Regular Coder
    Join Date
    Jun 2003
    Location
    Spokane, WA
    Posts
    512
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    624
    Thanks
    1
    Thanked 20 Times in 20 Posts
    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();

  • #7
    Regular Coder
    Join Date
    Jun 2003
    Location
    Spokane, WA
    Posts
    512
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please bear with me, I am still trying to wake up this morning

    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 ...

    -Ben

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    624
    Thanks
    1
    Thanked 20 Times in 20 Posts
    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.

  • #9
    Regular Coder
    Join Date
    Jun 2003
    Location
    Spokane, WA
    Posts
    512
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #10
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    624
    Thanks
    1
    Thanked 20 Times in 20 Posts
    Yes, don't use FrontPage.

    How about a direct FTP to upload it?

  • #11
    Regular Coder
    Join Date
    Jun 2003
    Location
    Spokane, WA
    Posts
    512
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #12
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    624
    Thanks
    1
    Thanked 20 Times in 20 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •