Hey guys,
Wracking my brain about this one.
My nice form (adapted it from somewhere) is deleting the spaces from the Name: field.
Here is the htm page:
<script type="text/javascript" src="/contact/mootools.js"></script>
<script type="text/javascript">
window.addEvent('domready', function(){
$('contact').addEvent('submit', function(e) {
new Event(e).stop();
var message = $('message_res').empty();
this.send({
update: message,
onComplete: function() {
document.contact.name.message();
}
});
});
});
</script>
......
<form id="contact" name="contact" action="/contact/send.php" method="get">
<div id="form_box">
<div>
<p>Your Name:</p>
<input name="name" type="text" tabindex="1" value="" size="35" />
</div>
.....
<div id="submit">
<button type="submit" onclick="this.blur()" name="button" tabindex="6" id="submitter"></button>
</div>
</form>
-
- <script type="text/javascript" src="/contact/mootools.js"></script>
- <script type="text/javascript">
- window.addEvent('domready', function(){
- $('contact').addEvent('submit', function(e) {
- new Event(e).stop();
- var message = $('message_res').empty();
- this.send({
- update: message,
- onComplete: function() {
- document.contact.name.message();
- }
- });
- });
- });
- </script>
- ......
- <form id="contact" name="contact" action="/contact/send.php" method="get">
- <div id="form_box">
- <div>
- <p>Your Name:</p>
- <input name="name" type="text" tabindex="1" value="" size="35" />
- </div>
- .....
- <div id="submit">
- <button type="submit" onclick="this.blur()" name="button" tabindex="6" id="submitter"></button>
- </div>
- </form>
Here is the php page:
elseif($_POST['sendtype'] == 'phone'){
$to = 'numberhere!@txt.att.net';
$headers = 'From: '.$_POST['name']. "\r\n" .
'X-Mailer: PHP/' . phpversion();
$subject = "";
$message = htmlspecialchars($_POST['message']) . $_POST['contact'];
}
- elseif($_POST['sendtype'] == 'phone'){
- $to = 'numberhere!@txt.att.net';
- $headers = 'From: '.$_POST['name']. "\r\n" .
- 'X-Mailer: PHP/' . phpversion();
- $subject = "";
- $message = htmlspecialchars($_POST['message']) . $_POST['contact'];
- }
Any idea why the space would get stripped?
There is no check except for the mootools, which shouldn't be doing any validation.
dyfrin.com