Click here to Skip to main content
15,881,248 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: send the more than one client and server program in java with source code Pin
Richard MacCutchan12-Sep-11 1:27
mveRichard MacCutchan12-Sep-11 1:27 
GeneralRe: send the more than one client and server program in java with source code Pin
Manfred Rudolf Bihy12-Sep-11 1:44
professionalManfred Rudolf Bihy12-Sep-11 1:44 
GeneralRe: send the more than one client and server program in java with source code Pin
Richard MacCutchan12-Sep-11 2:18
mveRichard MacCutchan12-Sep-11 2:18 
QuestionRegular expression Pin
Phrone7-Sep-11 9:21
Phrone7-Sep-11 9:21 
AnswerRe: Regular expression Pin
Firo Atrum Ventus7-Sep-11 17:46
Firo Atrum Ventus7-Sep-11 17:46 
GeneralRe: Regular expression Pin
Phrone7-Sep-11 20:22
Phrone7-Sep-11 20:22 
GeneralRe: Regular expression Pin
Member 215126112-Sep-11 9:26
Member 215126112-Sep-11 9:26 
QuestionJavascript Form Validation Pin
starr0077-Sep-11 9:09
starr0077-Sep-11 9:09 
When I test it, the only error I get is "Expected '(' Line: 17 Char: 1. Before that I had the return statement outside of function, I moved my return statement from where I validated the comment area outside and it worked, but it seems now I have more errors than I expected. Not too sure what I am leaving out or doing wrong.



HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact</title>
<link href="style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
function ValidateContactForm()
{
if (document.getElementById("author").value === "") 
{
	window.alert("Please provide a detailed description or comment.");
	document.getElementById("author").focus();
	}
if 
{
((!(/^([a-z0-9])([\w\.\-\+])+([a-z0-9])\@(([\w\-]?)+\.)+([a-z]{2,4})$/i.test(document.form2.

email.value)) { 
alert ("Invalid email address!  Please retry.");
document.ContactForm.email.value == "";  // clear the field
document.ContactForm.email.focus();  // and refocus on it
return false;
}
if (document.getElementById("text").value === "") 
{
	window.alert("Please provide a detailed description or comment.");
	document.getElementById("text").focus();
	}
return false;
}
}
</script>
</head>
<body>

<div id="templatemo_wrapper"> 

	<div id="templatemo_header">

 
        
        <ul id="social_box">
                    <li><a href="http://www.facebook.com/"><img 

src="images/facebook.png" alt="facebook" /></a></li>
            <li><a href="http://www.twitter.com/"><img src="images/twitter.png" 

alt="twitter" /></a></li>              
        </ul>
        
      	<div id="site_title">
            <h1><a href="index.htm"><img src="images/logo2.png" alt="logo" 

/><span></span></a></h1>
        </div> <!-- end of site_title -->
        
      
    </div> <!-- end of templatemo_header -->
    


<!-- end of templatemo_menu -->
    
    <div id="templatemo_content_wrapper">
    	<div id="templatemo_content_top"></div>
        <div id="templatemo_content">
        
            <h2>Contact</h2>



<p>E-mail: starr05@gmail.com </p>

<p><a href="http://www.twitter.com/">Twitter</a></p>
        
            <div class="cleaner_h50"></div>
            
            	<div id="contact_form">
            
                    <h4>Quick Contact</h4>
                    
                    <form method="post" name="ContactForm" id="contact" action="email.php" 

onsubmit="return ValidateContactForm();">
                        
                        <div class="col_w340 float_l">
                        
                            <label for="author">Name (* Required):</label> <input 

name="author" type="text" class="input_field" id="author" maxlength="40" />
                          	<div class="cleaner_h10"></div>

 <label for="subject">Subject:</label> <input name="subject" type="text" class="input_field" 

id="subject" maxlength="40" />
                          	<div class="cleaner_h10"></div>

                            
                            <label for="email">Email (* Required):</label> <input 

name="email" type="text" class="input_field" id="email" maxlength="40" />
                          	<div class="cleaner_h10"></div>
                            
                            
Type verification image:<br />
<input name="verif_box" type="text" id="verif_box" style="padding:2px; border:1px solid 

#CCCCCC; width:180px; height:14px;font-family:Verdana, Arial, Helvetica, sans-serif; 

font-size:11px;"/>
<img src="verificationimage.php?<?php echo rand(0,9999);?>" alt="verification image, type it 

in the box" width="50" height="24" align="absbottom" /><br />
<br />                        

</div>
                        


                        <div class="col_w340 float_r">
                        
                            <label for="text">Message (*Required):</label> <textarea 

id="text" name="text" rows="0" cols="0" class="required"></textarea>
                            <div class="cleaner_h10"></div>
                            
                            <input type="submit" class="submit_btn float_l" name="submit" 

id="submit" value="Send" />
                            <input type="reset" class="submit_btn float_r" name="reset" 

id="reset" value="Reset" />
                            
                        </div>
                        
                   </form>

            </div> 

            <div class="cleaner"></div>
            
        </div>
        <div id="templatemo_content_bottom"></div>
	</div>
    
    <div id="templatemo_sp_box">
    
    	<div class="col_w340 float_l">
         
			</div>
        </div>
        
        <div class="col_w340 float_r">
        
			</div>
        </div>
    
    </div>
    
    <div id="templatemo_footer">

      
        Copyright © 2011 <a href="www.twitter.com/">Starr</a><br/> 
        <a href="http://www.iwebsitetemplate.com" rel="nofollow" target="_parent">Website Templates</a> 
        by <a href="http://www.templatemo.com" rel="nofollow" target="_parent">Free CSS Templates</a>
    
    </div> <!-- end of templatemo_footer -->
    
</div> <!-- end of templatemo_wrapper -->    

</body>
</html>


HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>


<?php


$first_name=$_POST['name'];
$email_address=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['text'];

mail("starr05@gmail.com","Subject: $subject",
$message, "From: $first_name <$email_address>");

echo "Thank you for using our mail form.<br/>";
echo "Your email has been sent.";
?>




</body>
</html>


PHP
<pre lang="PHP">
<?php

header('Content-type: image/jpeg');

$width = 50;
$height = 24;

$my_image = imagecreatetruecolor($width, $height);

imagefill($my_image, 0, 0, 0xFFFFFF);

// add noise
for ($c = 0; $c < 40; $c++){
	$x = rand(0,$width-1);
	$y = rand(0,$height-1);
	imagesetpixel($my_image, $x, $y, 0x000000);
	}

$x = rand(1,10);
$y = rand(1,10);

$rand_string = rand(1000,9999);
imagestring($my_image, 5, $x, $y, $rand_string, 0x000000);

setcookie('tntcon',(md5($rand_string).'a4xn'));

imagejpeg($my_image);
imagedestroy($my_image);
?>




AnswerRe: Javascript Form Validation Pin
Peter_in_27807-Sep-11 21:59
professionalPeter_in_27807-Sep-11 21:59 
QuestionHelp with Ajax Pin
ShenDraeg7-Sep-11 8:56
ShenDraeg7-Sep-11 8:56 
AnswerRe: Help with Ajax Pin
Morgs Morgan7-Sep-11 21:04
Morgs Morgan7-Sep-11 21:04 
GeneralRe: Help with Ajax Pin
ShenDraeg8-Sep-11 3:56
ShenDraeg8-Sep-11 3:56 
GeneralRe: Help with Ajax Pin
Morgs Morgan8-Sep-11 4:29
Morgs Morgan8-Sep-11 4:29 
GeneralRe: Help with Ajax Pin
ShenDraeg8-Sep-11 6:40
ShenDraeg8-Sep-11 6:40 
GeneralRe: Help with Ajax Pin
ShenDraeg16-Sep-11 9:16
ShenDraeg16-Sep-11 9:16 
AnswerRe: Help with Ajax Pin
ShenDraeg13-Sep-11 9:09
ShenDraeg13-Sep-11 9:09 
Questionproblem with Joomla template - jQuery conflict mootols Pin
nikolay1006-Sep-11 0:04
nikolay1006-Sep-11 0:04 
AnswerRe: problem with Joomla template - jQuery conflict mootols Pin
nikolay1008-Sep-11 19:44
nikolay1008-Sep-11 19:44 
GeneralRe: problem with Joomla template - jQuery conflict mootols Pin
Firo Atrum Ventus8-Sep-11 20:09
Firo Atrum Ventus8-Sep-11 20:09 
Questionsimple javascrpt: checkbox Pin
AndyInUK2-Sep-11 7:13
AndyInUK2-Sep-11 7:13 
AnswerRe: simple javascrpt: checkbox Pin
Evan Gallup3-Sep-11 19:08
Evan Gallup3-Sep-11 19:08 
GeneralRe: simple javascrpt: checkbox Pin
AndyInUK5-Sep-11 5:43
AndyInUK5-Sep-11 5:43 
GeneralRe: simple javascrpt: checkbox Pin
Evan Gallup5-Sep-11 6:53
Evan Gallup5-Sep-11 6:53 
QuestionXML and Javascript Pin
Member 820418431-Aug-11 19:26
Member 820418431-Aug-11 19:26 
QuestionRe: XML and Javascript Pin
DaveAuld31-Aug-11 22:43
professionalDaveAuld31-Aug-11 22:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.