Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

textarea control !!

Javascript coding ..

Moderators: macek, egami, gesf

textarea control !!

Postby unisabilly » Mon May 15, 2006 11:36 pm

Code: Select all
<input class="bginput" type="text" name="keywords" size="15"  value="enter your text here ..." onFocus="if (this.value=='enter your text here ...') {this.value=''}" onBlur="if(this.value=='')this.value='enter your text here ...' ">


what will the code look like if i want the 'textarea' do somthing like the above code did to the 'text'.
unisabilly
New php-forum User
New php-forum User
 
Posts: 19
Joined: Wed Aug 17, 2005 6:00 am

Postby gesf » Mon May 22, 2006 5:47 am

:? Didn't get your question!
User avatar
gesf
Moderator
Moderator
 
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Postby GedroX » Mon May 22, 2006 11:34 pm

Almoust the same:

Code: Select all
<textarea class="bginput" type="text" name="keywords" size="15" onFocus="if (this.innerHTML=='enter your text here ...') {this.innerHTML=''}" onBlur="if(this.innerHTML=='')this.innerHTML='enter your text here ...' ">enter your text here ...</textarea>


Image
User avatar
GedroX
New php-forum User
New php-forum User
 
Posts: 49
Joined: Fri Apr 07, 2006 1:15 am

hi

Postby ramesh » Tue Jan 30, 2007 11:39 pm

I think u wanted to check if some field is left empty or not-right?If so then do the followings:

<script language="text/JavaScript">
function checkfield()
{
var a=document.form.text1.value;
if(a=="")
{
alert("The fields are empty!Please fill them");
}
}

</script>
<input type ="text" name="text1" onblur="return checkfield()">
User avatar
ramesh
New php-forum User
New php-forum User
 
Posts: 39
Joined: Sun Dec 10, 2006 2:00 am
Location: POKHARA


Return to JavaScript

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.