Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6039549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:23:05+00:00 2026-05-23T06:23:05+00:00

This is the code of my form <form method=post style=margin-left:15px;margin-top:6px; onsubmit=return map_Email_Validation();> <table> <tr>

  • 0

This is the code of my form

<form method="post" style="margin-left:15px;margin-top:6px;" onsubmit="return map_Email_Validation();">

    <table>
        <tr>
         <td colspan="2" class="faceboxheading" style="white-space:nowrap;">Share your map information with your friends</td>
            <td colspan="2" align="left"><a href="javascript:void(0);" class="hrf_btn" onclick="hide_facebox();">[x]</a></td>
        </tr>
      <tr></tr>
      <?php if($error) {?>
      <tr>
        <td colspan="2" class="faceboxheading"><?php echo $error;?></td>
      </tr>
      <?php }?>
      <tr>
        <td width="100px">To Email</td>

        <td width="250px"><input type="text" name="ToID" id="ToID" style="width:274px;" onkeyup="dis();"/></td>
      </tr>
      <tr>
        <td>From Email</td>
        <td><input type="text" name="fromID" id="fromID" style="width:274px;" onkeyup="dis();" value="'.$g['email'].'" /></td>
      </tr>
      <tr>
        <td>Subject</td>
        <td><input type="text" name="subject" id="subject" style="width:274px;" onkeyup="dis();"/></td>
      </tr>
      <tr>
        <td>URL</td>
        <td><input type="text" readonly="readonly" name="URL" id="URL" size="42" style="width:274px;"/></td>
      </tr>
      <tr>
        <td>Message</td>
        <td valign="top"><textarea id="message" name="message" cols="25" rows="4" style="width:274px;" onkeyup="dis();"></textarea></td>
      </tr>
     <tr><td></td>  
   <td> <input type="image" style="margin-left:-2px;" src="http://jersey.cimaps.co.uk/jersey_dev/templates/default/images/send.png" name="submitbtn" id="submitbtn" value="Send"/></td>

</td></tr>

    </table>
  </form>

The functions are

function map_Email_Validation()
{

        var ToID = document.getElementById('ToID').value;      
        //var fromID = document.getElementById('fromID').value;
        var subject = document.getElementById('subject').value;
        var message = document.getElementById('message').value;
        var char_at=ToID.indexOf("@");
        var char_dot=ToID.indexOf(".");
        var char_dolar=ToID.indexOf("$");
        var char_hash=ToID.indexOf("#");
        var at="@";

                var lat=ToID.indexOf(at);
if(ToID.length<1)
        {
            alert('Please enter To Email!');
            return false;
        }
        else if((char_at==-1)||(char_dot==-1)||(char_dolar!=-1)||(char_hash!=-1))
        {
            alert( 'Invalid To Email!');
            return false;
        }
        else if((char_at==0)||(char_dot==1)||(char_dot==char_at+1))
        {
            alert( 'Invalid To Email!');
            return false;
        }
if(subject.length<1)
        {
            alert( 'Please enter Subject!');
            return false;
        }
        if(message.length<1)
        {
            alert( 'Please enter Message!');
            return false;
        }
        else if(message.length>100)
        {
            alert( 'Message can have only 100 characters!');
            return false;
        }

return true;    
}
code in index page is
if(isset($_POST['submitbtn']))
{
    //echo "set";

    $flag=true;
    $error="";
    /*Getting Values**********************/
    $ToID=$_POST['ToID'];
    $fromID=$_POST['fromID'];
    $subject=$_POST['subject'];
    $URL=$_POST['URL'];
    $message=$_POST['message'];

    /*Validating the data*****************/
    if(strlen($ToID)==0)
    {
        $flag=false;
        $error.="Enter To email address field"; 
    }
    elseif(!preg_match_all("|^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$|U",$ToID,$arr))
    {
        $flag=false;
        $error.="Invalid To email address"; 
    }
if(strlen($subject)==0)
    {
        $flag=false;
        $error.="Enter subject field";  
    }
    if(strlen($message)==0)
    {
        $flag=false;
        $error.="Enter message field";  
    }
    elseif(strlen($message)>100)
    {
        $flag=false;
        $error.="Message can have only 100 charaters";  
    }

    if($flag=="true")
    {

        $urltoemail = "<html><head><title>Forgot Password</title></head><body>
<table><tr><td>".$message."</td></tr><tr><td><a href='{$URL}'>Click here for viewing map</a></td></tr></table></body></html>";
        $headers = "MIME-Version: 1.0" . "\r\n";
        $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
        if(strlen($fromID)==0)
        $fromID = 'info@cimaps.co.uk';
        $headers .= "From: $fromID \r\n";
        mail($ToID,$subject,$urltoemail,$headers);
        //header("Location:".$_SERVER['SCRIPT_NAME']);
    }

}

The mail doesnot sent in IE but successfully in all other browsers..Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:23:06+00:00Added an answer on May 23, 2026 at 6:23 am

    I’m not sure and I don’t fully understand the fix that you had made. But for me, the check if(isset($_POST['submitbtn'])) fails in both IE8 and FF4; it worked fine in Chrome12. And the reason is that when you are using an <input type="image"> kind of button to submit the form, you need to check it like this:

    if(isset($_POST['submitbtn_x'])) {
        ...
        ...
    }
    

    And that check will work on all browsers. To check this, you may like to do a print_r($_POST) just before where the if() starts and see how it looks like.

    Hope this helps to solve your problem.

    /Abhay

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

y0 c0derz! My formula looks like this: <form method=post action=index.php?sida=upl enctype=multipart/form-data name=myform> <input type=file
This code is executed by many way. When it's executed by the form button
The resource editor keeps wiping out code of this form in my .rc: #ifndef
In my views.py, i have a snippit of code like this: def clean_post_data(form): for
I'm getting this error on a compact framework form. code generation for property 'inputControl'
This code in JS gives me a popup saying i think null is a
This code is from Prototype.js . I've looked at probably 20 different tutorials, and
this code always returns 0 in PHP 5.2.5 for microseconds: <?php $dt = new
This code works (C# 3) double d; if(d == (double)(int)d) ...; Is there a
This code always works, even in different browsers: function fooCheck() { alert(internalFoo()); // We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.