Forums

FormBuilder Value issue (4 posts)

  1. overhaulmedia
    Member
    Posted 2 years ago #

    How can I modify this so the value is removed when the user clicks?
    I feel like it's a very bad practice to have a value (hint) then make the user delete it to put in their own. Usually we use a tiny bit of javascript to remove the value on click.

  2. Marventus
    Member
    Posted 2 years ago #

    Hi overhaulmedia,

    Check out the search bar in this blog I run: is this the effect you're trying to accomplish?
    If it is, this is how I did it:
    <input type="text" onblur="if (this.value == '') {this.value = 'Type your query here...';}" onfocus="if (this.value == 'Type your query here...') {this.value = '';}" value="<?php if ($_REQUEST['s']) { the_search_query(); } else { echo 'Type your query here...'; } ?>" name="s" id="s" />
    You can customize the input type, default values (in my case, the default value of the Search field is "Type your query here..."), and name and id of the field.
    Hope this is helpful.

  3. mikemcd22
    Member
    Posted 1 year ago #

    Along these same lines, How can I have the value of radio buttons and drop down lists unselected until the user makes a selection?

    http://03202de.netsolhost.com/?page_id=5

  4. TruthMedia
    Member
    Posted 1 year ago #

    Hi overhaulmedia and mikemcd22,

    At this point, FormBuilder doesn't support removing default values on click. When HTML5 becomes more standardized it should support fields for preview text and we hope to incorporate that there.

    As for unselected dropdown boxes, simply leave a blank line as the first option in your range of options when creating the form.

    James W.

Topic Closed

This topic has been closed to new replies.

About this Topic