Web Global Net Web Application & Web Development Project Center

Technical Issues => Javascripting => Topic started by: admin on April 22, 2010, 11:16: AM



Title: Select content of a Text field or Textarea when a user clicks in the text field
Post by: admin on April 22, 2010, 11:16: AM
Add this little script either in the head area or even before the field being used

<script type="text/javascript">
function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}
</script>


Sample of text field  - the Bold needs to be added to the field information


                              <label>
                              <input name="textfield" type="text"  id="txtfld" onClick="SelectAll('txtfld');" class="form_input_required_menu" value="Value showing within the field" size="65" />