SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Issues with placeholder value

    How can I write javascript that states, if an input field = this text, then empty the input before submitting?

    Thank you for you help

    By the way I thought that is what this was saying, but it still submits the placeholder as a value?:

    $('[placeholder]').parents('form').submit(function() {
    $(this).find('[placeholder]').each(function() {
    var input = $(this);
    if (input.val() == input.attr('placeholder')) {
    input.val(' ');
    }
    })
    });
    Last edited by ralph.m; Jul 19, 2013 at 16:59.


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
  •