-
Ah! Sorry. That will give you errors, obviously.... you type an email in, then it'll replace it with your@email.com when you click out.
Here's the fix:
<input name="email" type="text" value="your@email.com" onFocus="if (this.value=='your@email.com') {this.value='';}" onBlur="if (this.value=='') {this.value='your@email.com';}">
Additionally, you wouldn't want people submitting your@email.com to the thing.
I'd suggest:
<form action="page.php" method="post" onSubmit="if (email.value=='your@email.com') {alert('Please enter your email.'); email.focus(); return false;}">
Note that the stuff in italics can change... use the existing values in your form.
-
wow! too good...
can i add this to my already existing page?
-
Yes. Just add the important pieces above (everything for the input tag, and everything not in italics for the form tag) to the form you have on the page.
-
I had some PHP on the code before... Do I still need that?
Code:
<INPUT TYPE="text" NAME="email" VALUE="<?php echo $email; ?>">
-
ok all done... don't you think this thing just keeps getting better and better!? it'll go down in the forum history books... ha!
do we know how to use the trim function from twey?
-
ok all done... don't you think this thing just keeps getting better and better!? it'll go down in the forum history books... ha!
do we know how to use the trim function from twey?
-
Actually, I'm not sure where he intended it to be used 'cause it seems like there are two places it would fit.
Either way, I can just add it to both.
Is the .txt updated?
-
yea i wasn't sure either... ok yep txt file all updated... also had a look at your code to try and work out how to disable the alert box if no proper email is entered but no luck :(
-
Not sure if I'll fix all that tonight... sorry I'm slow.
I'm looking through some stuff, and this is totally pointless:
Code:
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
That's part of your javascript. It's rediculous. No clue why that is a "function".
All it does is pass the value MM_popupMSg(THIS) to alert(HERE), which is pointless.
In your body tag, use:
PHP Code:
<BODY<?php if ($message == "") { ?> onLoad="alert('Curious? You should be. Sydney’s rebel Ronins of streetwear are dropping their Kimono’s and picking up gear sharper than any katana from the label that killed the cats you used to love.\r\rLike an army of modern day Mifune, the Samurai of the street blend into their surroundings, snuffing the less than worthy with killer prints and cuts this season.\r\rSleek, clean killers the Curious clothing range Ronin and Geisha are decked out in tees and singlets that reflect the nature of our fine city – crucifixes in a sombre, demure black print or laughing in the pews with glitzy, ironic silver or gold foil. The hurricane-fence print reminds you of which side of the tracks you hail from… Skulls bump heads with the clouds in a range that comes from the street, but stretches to the sky. Fashion victims? Maybe….\r\rstockists?? + 61 415 397 606');"<?php }?> >
Well... yeah, I think that's it for tonight.
I'll get to the rest when I get a chance. Sorry :)
EDIT: Actually, that entire javascript isn't doing anything for you. Remove it all.
HTML Code:
<SCRIPT LANGUAGE="JavaScript" TYPE="text/JavaScript">
<!--
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</SCRIPT>
-
Dreamweaver does that a lot. Its "jumpMenu" script is quite funny too -- about five lines of complex, virtually unreadable Javascript, including a couple of eval calls, to do something that can be accomplished with a single statement in an event handler.