Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7786783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:28:43+00:00 2026-06-01T20:28:43+00:00

I have two scripts for clearing my form and using input hints. The input

  • 0

I have two scripts for clearing my form and using input hints. The input hints are not returning AFTER I execute the clear function.

function clear_form_elements(ele) {

$(ele).find(':input').each(function() {
switch(this.type) {
    case 'password':
    case 'select-multiple':
    case 'select-one':
    case 'text':
    case 'textarea':
        $(this).val('');
        $("  .bx4a").removeAttr("style");
        $("  .bxTXTa").removeAttr("style");
        $("  .bxTXTa2").removeAttr("style");
        $("  .bx4a2").removeAttr("style");
        $("  .bx").removeAttr("style");
        $("  .ts").removeAttr("style");
        $("  .button-toggle-on").removeAttr("style");
        $("  .gnM").removeAttr("style");
        $("  .gnF").removeAttr("style");
        break;
    case 'checkbox':
    case 'radio':
        this.checked = false;
   }
  });

 }






 // jQuery Input Hints plugin
 // Copyright (c) 2009 Rob Volk
 // http://www.robvolk.com

jQuery.fn.inputHints=function() {
// hides the input display text stored in the title on focus
// and sets it on blur if the user hasn't changed it.

// show the display text
$(this).each(function(i) {
    $(this).val($(this).attr('title'))
        .addClass('hint');
});

// hook up the blur & focus
return $(this).focus(function() {
    if ($(this).val() == $(this).attr('title'))
        $(this).val('')
            .removeClass('hint');
}).blur(function() {
    if ($(this).val() == '')
        $(this).val($(this).attr('title'))
            .addClass('hint');
});
};

$(document).ready(function() {$('input[title],textarea[title]').inputHints();});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:28:44+00:00Added an answer on June 1, 2026 at 8:28 pm

    The strategy for hint text is really simple: set the default value of the input to the hint text that you want, then when it gets focus set the value to ”. Then onblur, if the value is still ”, set the value to the default value. e.g.

    <label for="userName">Name:<input name="userName" id="userName"
     value="Your full name&hellip;" class="hint"></label>
    
    <script>
    function hintFocus() {
      if (this.value == this.defaultValue) this.value = '';
    }
    function hintBlur(el) {
      if (this.value == '') this.value = this.defaultValue;
    }
    
    // Add the listeners
    var el = document.getElementById('userName');
    el.onfocus = hintFocus;
    el.onblur = hintBlur;
    </script>
    

    Use a standard reset button for the form and give it a listener so it adds the hint class to input type text and textarea (as appropriate) when the form is reset.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two PHP scripts, both using the same session by calling session_name('MySessID') .
I have two scripts say 'S1' and 'S2'. I execute these scripts as, nohup
I have two jQuery scripts - One for inline form editing and the second
I have two scripts that often need to be run with the same parameter:
I have two scripts running on the same page, one is the jQuery.hSlides.js script
I have two SQL scripts which get called within a loop that accept a
I have the following two php scripts remove_directory.php <?php start_session(); $userId = $_SESSION['userId']; exec(escapeshellcmd(rm
Suppose you have a string with text in two or more scripts. When you
I have two scripts, a python script and a perl script. How can I
I have two scripts. running an update and calling shell_exec('svn update') and shell_exec('svn st')

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.