Page 11 of 14 FirstFirst ... 910111213 ... LastLast
Results 101 to 110 of 137

Thread: javascript? php? simple mailing list database?

  1. #101
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  2. #102
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    wow! too good...

    can i add this to my already existing page?

  3. #103
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #104
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I had some PHP on the code before... Do I still need that?
    Code:
    <INPUT TYPE="text" NAME="email" VALUE="<?php echo $email; ?>">

  5. #105
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  6. #106
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  7. #107
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #108
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  9. #109
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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&rsquo;s rebel Ronins of streetwear are dropping their Kimono&rsquo;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 &ndash; 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&hellip; Skulls bump heads with the clouds in a range that comes from the street, but stretches to the sky. Fashion victims? Maybe&hellip;.\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>
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  10. #110
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •