Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • julianw Friend
    #158741

    Hi everybody,

    I have just a little issue, but it drives me wild.
    In the community+ (and some other templates) there is an eMail-subscribe-form. In the fields it says “your eMail” and “your Name”, as soon as the user “klicks” into that filed the words disappear so he can type his Name and his eMail in.

    I am getting mad, because my code always leaves the words in, so the user has manually to delete them. I found nothing in the internet, I found nothing here in the forums, and trying to “adjust” the code that is in the original template also didn´t work.

    Could anybody have a little look on the code and give me a hint about what I am doing wrong? This is the code I use:

    [PHP]
    <form id=”form-subscribe” action=”http://www.newsletter.nlp-deutschland.de/box.php” enctype=”application/x-www-form-urlencoded” method=”post”>
    <p><label for=”subscribe-name”><input class=”subscribe-name” name=”first_name” type=”text” value=”Dein Vorname” /></label></p>
    <p><label for=”subscribe-email”><input class=”subscribe-email” name=”email” type=”text” value=”Deine eMail” /></label></p>
    <input class=”button” type=”submit” value=”Bestellen” /> <input name=”funcml” type=”hidden” value=”add” /> <input name=”p” type=”hidden” value=”1002″ /> <input name=”_charset” type=”hidden” value=”utf-8″ /> <input name=”nlbox[]” type=”hidden” value=”5″ /> </form>[/PHP]

    All the best, Julian!

    smitheringale Friend
    #371855

    Did you replace the standard code with your own code? If yes, then it won’t neccessarily behave as in the demo.

    From what I can tell, the following code is used in community plus (see code below). I think that it is using some extra code (that is missing on your form) to remove the text on click.

    Notice that this code is present on community plus but missing in your code onfocus=”if (this.value == ‘Your name’) {this.value = ”;}” onblur=”if (this.value == ”) {this.value = ‘Your name’;}

    <form id="form-subscribe">
    <p><label for="subscribe-name"><input gtbfieldid="17" class="subscribe-name" name="subscribe-name" value="Your name" onfocus="if (this.value == 'Your name') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Your name';}" type="text"></label></p>

    <p><label for="subscribe-email"><input gtbfieldid="18" class="subscribe-email" name="subscribe-email" value="Email" onfocus="if (this.value == 'Email') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Email';}" type="text"></label></p>
    <input value="Subscribe" class="button" type="submit">
    </form>

    <em>@julianw 214984 wrote:</em><blockquote>Hi everybody,

    I have just a little issue, but it drives me wild.
    In the community+ (and some other templates) there is an eMail-subscribe-form. In the fields it says “your eMail” and “your Name”, as soon as the user “klicks” into that filed the words disappear so he can type his Name and his eMail in.

    I am getting mad, because my code always leaves the words in, so the user has manually to delete them. I found nothing in the internet, I found nothing here in the forums, and trying to “adjust” the code that is in the original template also didn´t work.

    Could anybody have a little look on the code and give me a hint about what I am doing wrong? This is the code I use:

    [PHP]
    <form id=”form-subscribe” action=”http://www.newsletter.nlp-deutschland.de/box.php” enctype=”application/x-www-form-urlencoded” method=”post”>
    <p><label for=”subscribe-name”><input class=”subscribe-name” name=”first_name” type=”text” value=”Dein Vorname” /></label></p>
    <p><label for=”subscribe-email”><input class=”subscribe-email” name=”email” type=”text” value=”Deine eMail” /></label></p>
    <input class=”button” type=”submit” value=”Bestellen” /> <input name=”funcml” type=”hidden” value=”add” /> <input name=”p” type=”hidden” value=”1002″ /> <input name=”_charset” type=”hidden” value=”utf-8″ /> <input name=”nlbox[]” type=”hidden” value=”5″ /> </form>[/PHP]

    All the best, Julian!</blockquote>

    julianw Friend
    #373225

    Hi Smith,

    great, thx, that was the solution !!!

    I still am weired about the whole thing. I also installed a demo on the Joomart-Website and looked into it. It did work, but as soon as I copied the code from the module with the editor from the demo-installation to my website it didn´t work anymore. But there also the lines, that you mentioned, where missing.

    Maybe this can be because of the “active editor”. I noticed sometimes that the editor has it´s own life and changes things. Maybe ..

    However, it´s working now, so thank you a lot!

    All the best, Julian!

Viewing 3 posts - 1 through 3 (of 3 total)

This topic contains 3 replies, has 2 voices, and was last updated by  julianw 13 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum