textarea control !!

Javascript coding ..

Moderators: egami, macek, gesf

Post Reply
unisabilly
New php-forum User
New php-forum User
Posts: 19
Joined: Wed Aug 17, 2005 6:00 am

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'.

User avatar
gesf
Moderator
Moderator
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Mon May 22, 2006 5:47 am

:? Didn't get your question!
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

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

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
ramesh
New php-forum User
New php-forum User
Posts: 39
Joined: Sun Dec 10, 2006 2:00 am
Location: POKHARA

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()">
RameshRaj
Best Of Luck!!!

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests