fikiwan Posted May 5, 2012 Share Posted May 5, 2012 hai friends , can do help me ,how to create value in form disappear when clicked,when form clicked then value in form disappear ...like form search in here , I clicked form and word search disappear ..how to make like tht, ..thks before Link to comment Share on other sites More sharing options...
Don E Posted May 5, 2012 Share Posted May 5, 2012 onfocus="this.value=''" Example: <input type="text" name="search" value="Search..." onfocus="this.value=''"> 1 Link to comment Share on other sites More sharing options...
dsonesuk Posted May 5, 2012 Share Posted May 5, 2012 <input type="text" name="search" value="Search..." onfocus="this.value=''"> once the input has focus, the input value is cleared completely and will never show again, if you make a mistake and to wish to correct the spelling you end up with same problem. One option is to identify when it is default value, hide, But! if not, keep the value entered, also if value deleted manually and you leave the input, return to default value. <input type="text" name="search" value="Search..." onfocus="if(this.value==this.defaultValue){this.value=''}" onblur="if(this.value==''){this.value=this.defaultValue}"> 1 Link to comment Share on other sites More sharing options...
fikiwan Posted May 5, 2012 Author Share Posted May 5, 2012 (edited) <input type="text" name="search" value="Search..." onfocus="this.value=''"> once the input has focus, the input value is cleared completely and will never show again, if you make a mistake and to wish to correct the spelling you end up with same problem. One option is to identify when it is default value, hide, But! if not, keep the value entered, also if value deleted manually and you leave the input, return to default value. <input type="text" name="search" value="Search..." onfocus="if(this.value==this.defaultValue){this.value=''}" onblur="if(this.value==''){this.value=this.defaultValue}"> thanks so much bro its work, and how make style value in the form , I want change color, type word,large word ect Edited May 5, 2012 by fikiwan Link to comment Share on other sites More sharing options...
dsonesuk Posted May 5, 2012 Share Posted May 5, 2012 input[type=text] { font-size:20px; color: red;} 1 Link to comment Share on other sites More sharing options...
fikiwan Posted May 6, 2012 Author Share Posted May 6, 2012 input[type=text] { font-size:20px; color: red;} ya I knew like that, I can do in style css, But I want style value in the form not same if I fill the data, .. you can try in form search here,if you write a word in the form ,style value which disappear different with style word you write,. hw to make like that you could help me !!, thks before .. note : sorry my english not good Link to comment Share on other sites More sharing options...
dsonesuk Posted May 6, 2012 Share Posted May 6, 2012 ??? you mean like this input[type="text"] { color: #5A5A5A; font-family:"Century Gothic";} <input type="text" name="search" value="Search..." onfocus="if(this.value==this.defaultValue){this.value='';} this.style.color='#000000'; this.style.fontSize='16px';" onblur="if(this.value==''){this.value=this.defaultValue;this.style.color='#5a5a5a';this.style.fontSize='14px';}else{this.style.color='#000000'; this.style.fontSize='14px';}"> 1 Link to comment Share on other sites More sharing options...
fikiwan Posted May 7, 2012 Author Share Posted May 7, 2012 ya liki this , thanks for the help mastah Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now