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 7 of 7
  1. #1
    New Coder
    Join Date
    Nov 2002
    Location
    Israel
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Few problems with my code (form and menu)

    Hy
    i have the following code:
    Everything works nicely exept few things:
    1) In the "FROM" field we should receive the real mail of the sender and not this text: ----@name.com, what should i do?

    2) I tried to use a select field instead of an inbox but the "function CheckRequired" didn't work, why ???

    3)That question doesn't concern the form but the menu, my javascript pulldown menu loads very slow, what script should i add to make him load faster?

    Thank in advance



    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>
    <head>
    <title>Untitled</title>
    </head>
    <script language="JavaScript">
    function CheckRequired(){
    a = document.all['FirstName'].value.length;
    b = document.all['LastName'].value.length;
    c = document.all['Company'].value.length;
    d = document.all['Country'].value.length;
    e = document.all['Phone'].value.length;
    f = document.all['Email'].value.length;
    if(a<=0 || b<=0 || c<=0 || d<=0 || e<=0 || f<=0 ){
    alert("Enter All required fields");
    return false;
    }
    }
    </script>
    <body bgcolor=#FFFFFF>
    <script type='text/javascript'>
    function Go(){return}</script>
    <script type='text/javascript' src='exmplmenu_var.js'></script>
    <script type='text/javascript' src='menu_com.js'></script>
    <noscript>Your browser does not support script</noscript>
    <center>

    <FORM ACTION="http://userscripts/mail.pl" METHOD="POST" onsubmit="return CheckRequired();">

    <INPUT TYPE="HIDDEN" NAME="toemail" VALUE="download@name.com">
    <INPUT TYPE="HIDDEN" NAME="fromemail" VALUE="--------@name.com">
    <INPUT TYPE="HIDDEN" NAME="subject" VALUE="name.com DownLoad">

    <INPUT type=hidden value="N" name="answer_done">
    <INPUT type=hidden value="currentDate()" name="date_sent">
    <INPUT type=hidden value="download-site.html" name="resulturl">
    <INPUT type=hidden value="download@name.com" name="sendto">
    <INPUT type=hidden value="Down Loads" name="subject">
    <table>
    <tr><td>FirstName</td><td><INPUT type=text value="" name="FirstName"> </td></tr>
    <tr><td>LastName</td><td><INPUT type=text value="" name="LastName"> </td></tr>
    <tr><td>Company</td><td><INPUT type=text value="" name="Company"> </td></tr>
    <tr><td>Country</td><td><INPUT type=text value="" name="Country"> </td></tr>
    <tr><td>Phone</td><td><INPUT type=text value="" name="Phone"> </td></tr>
    <tr><td>Email</td><td><INPUT type=text value="" name="Email"></td></tr>
    <tr><td>Email</td><td><INPUT type=submit value="click" name="sub"></td></tr>
    </table>
    </form>

    </body>
    </html>

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    I may have the answer to your first question.

    Please note document.all is IE only

    <html>
    <head>
    <title>Untitled</title>
    </head>
    <script language="JavaScript">
    function CheckRequired(){
    document.f1.fromemail.value=document.f1.Email.value

    a = document.f1.FirstName.value.length;
    b = document.f1.LastName.value.length;
    c = document.f1.Company.value.length;
    d = document.f1.Country.value.length;
    e = document.f1.Phone.value.length;
    f = document.f1.Email.value.length;
    if(a<=0 || b<=0 || c<=0 || d<=0 || e<=0 || f<=0 ){
    alert("Enter All required fields");
    return false;
    }
    alert(document.f1.fromemail.value)
    }

    </script>
    <body bgcolor=#FFFFFF>
    <script type='text/javascript'>
    function Go(){return}</script>
    <script type='text/javascript' src='exmplmenu_var.js'></script>
    <script type='text/javascript' src='menu_com.js'></script>
    <noscript>Your browser does not support script</noscript>
    <center>

    <FORM name="f1" ACTION="http://userscripts/mail.pl" METHOD="POST" onsubmit="return CheckRequired();">

    <INPUT TYPE="HIDDEN" NAME="toemail" VALUE="download@name.com">
    <INPUT TYPE="HIDDEN" NAME="fromemail" VALUE="--------@name.com">
    <INPUT TYPE="HIDDEN" NAME="subject" VALUE="name.com DownLoad">

    <INPUT type=hidden value="N" name="answer_done">
    <INPUT type=hidden value="currentDate()" name="date_sent">
    <INPUT type=hidden value="download-site.html" name="resulturl">
    <INPUT type=hidden value="download@name.com" name="sendto">
    <INPUT type=hidden value="Down Loads" name="subject">
    <table>
    <tr><td>FirstName</td><td><INPUT type=text value="" name="FirstName"> </td></tr>
    <tr><td>LastName</td><td><INPUT type=text value="" name="LastName"> </td></tr>
    <tr><td>Company</td><td><INPUT type=text value="" name="Company"> </td></tr>
    <tr><td>Country</td><td><INPUT type=text value="" name="Country"> </td></tr>
    <tr><td>Phone</td><td><INPUT type=text value="" name="Phone"> </td></tr>
    <tr><td>Email</td><td><INPUT type=text value="" name="Email"></td></tr>
    <tr><td>Email</td><td><INPUT type=submit value="click" name="sub"></td></tr>
    </table>
    </form>

    </body>
    </html>

  • #3
    New Coder
    Join Date
    Nov 2002
    Location
    Israel
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Take a look here for a possible answer to your second question


    http://www.huntingground.freeserve.c...f_validate.htm

  • #5
    New Coder
    Join Date
    Nov 2002
    Location
    Israel
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    About my first question, thank you MR J for the answer, but it doesn't work.

    Where should i look for the answer? i tried on the net but without success.

    Thanks

    Yael

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Quote Originally Posted by yaelbe
    About my first question, thank you MR J for the answer, but it doesn't work.
    Why not just rename the Email field to fromemail

    <INPUT type=text value="" name="Email"> --> <INPUT type=text value="" name="fromemail">

    and then removing this hidden field

    <INPUT TYPE="HIDDEN" NAME="fromemail" VALUE="--------@name.com">

  • #7
    New Coder
    Join Date
    Nov 2002
    Location
    Israel
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thanks all

    thanks all


  •  

    Posting Permissions

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