Link to home
Start Free TrialLog in
Avatar of InNoCenT_Ch1ld
InNoCenT_Ch1ld

asked on

clear text field when received focus

hi, i need a script for a text field, when the text field received focus, anything in the text field will be remove and the user can enter his/her data without the need of deleting existing data?

can this be done? tks
ASKER CERTIFIED SOLUTION
Avatar of rama_krishna580
rama_krishna580
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or try this...

<html>
<head>
<title>Clear Form Demo</title>

<script language="javascript">
<!--
function ClearForm() {
  document.testform.email.value= "";
}

//-->
</script>

</head>

<body>

<form name="testform">
    <input type="text" name="email" value="Something here." onfocus="ClearForm();">
</form>
</body>
</html>

R.K
Avatar of InNoCenT_Ch1ld
InNoCenT_Ch1ld

ASKER

tks ;-)