Help - Search - Members - Calendar
Full Version: HTML input
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
I have a form used to collect info from a web site user in this manner:
<label>What is your mother's maiden name? <input id = "txtMaiden" name = "txtMaiden" type = "text" value = "" size="25" maxlength = "25" /></label><br />

I would like to have the text be visible, just as typed by the user, when the user is in that field. But when the user selects the next field on my form, I would like the field to show only asterisks or spaces as if it were a password. The text should only be visible when it is being entered or modified.

Is this possible?

Thanks in advance for any insight or suggestions!!

Christian J
You might use javascript onblur and onfocus to change its TYPE atribute value between "text" to "password":

<input type="text" onblur="this.type='password';" onfocus="this.type='text';">
This can be solved using the following JQuery:
<label for="add_fields_placeholder">Placeholder: </label>
<select name="add_fields_placeholder" id="add_fields_placeholder">
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
<option value="500">500</option>
<option value="1000">1000</option>
<option value="Other">Other</option>
<div id="add_fields_placeholderValue">
Price:<input type="text" name="add_fields_placeholderValue" id="add_fields_placeholderValueInput">

if($(this).val() == "Other") {
else {

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.