New to the forum

BeatBlocked

New Member
Did you code that website? Also why can't you just put a separate form for each link? http://www.beatblockedproductions.com/submit/question, http://www.beatblockedproductions.com/submit/testimonial.. etc

yes i did code the website and I could separate the pages but this is something i thought would be user friendly if it was all in one page.

worst case i will end up separating the pages but with each webdesign i do i always want to try something new. but got stumped so now im here.
 

BeatBlocked

New Member
I also had another question.

How could i add a email verifier and feedback message to pop up when its not a valid format?

Here is my php and form code.

PHP
Code:
<?php

$to ='EMAIL@HERE';
$subject ='Website Question';

$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];

$body = <<<EMAIL

Question from $name

$message

From $name
$email

EMAIL;

$header = "From: $email";

if($_POST){
	if($name =='' || $email == '' || $message == ''){
		$feedback = 'Please fill out all fields before submitting';
	}else{
		mail($to, $subject, $body, $header);
    	$feedback = 'Thank you for your email';
	}
}
?>

FORM
Code:
<div class="box" style="width: 320px; margin: 0 auto">
<p id="feedback"><?php echo $feedback; ?></p>
<form class="form" action="?" method="post">
<ul>
	<li>
		<label for="name">Name:</label>
		<input type="text" name="name" id="name">
    </li>
    <li>
    	<label for="email">Email:</label>
        <input type="text" name="email" id="email">
    </li>
    <li>
    	<label for="message">Message:</label>
        <textarea name="message" id="message" rows="9"></textarea>
    </li>
    <li>
    	<input type="submit" name="submit" id="submit" value="Send">
    </li>
</ul>
</form>
</div>
 

Nitzband

New Member
Hey here is a simple JavaScript script that I wrote, that lets a user know if they left the .com or @ in an email address for a form. I hope this helps

Code:

function ValidateEmail (email)

{

var aT = email.indexOf('@')

if (aT == -1)

{

alert ('You entered an invalid email address. (error: missing "@")')

}

var com = email.indexOf('.com')

if (com == -1)

{

alert('You entered an invalid email address. (error: missing ".com")')

}

}
 

BeatBlocked

New Member
Hey Thanx Nitzband,


Now im fairly new to php/javascript so how would I incorporate that code into mine??

Would i have have to modify any portion or your code? If so what?

thanx in advance
 
Top