Ask onclick method

Links for php scripts

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 3
Joined: Mon May 28, 2012 7:12 pm

Ask onclick method

Postby dewawira » Mon May 28, 2012 7:45 pm

Good morning... :yawn:
I have made searching box use onclick method, so i hope the searching box have a temporary text and when i click on searching bvox, the text is dissapear, but until now, i didn't do like that..please check my code..i have attached picture that i hope...

include "config/koneksi.php";

// Form Pencarian
echo "<tr><td colspan=2><img src=images/search.png></td></tr>
<tr><td colspan=2>
<form method=POST action='?module=hasilcari'>
<input type=text name=kata class=txt-search title='Ketik yang anda cari lalu tekan enter' value='Quick Search' onfocus=if(this.value =='Quick Search') {this.value = ' ';}>
<input type=submit name=s id=s class=s>
<hr color=#265180></td></tr>";


I think i have a mistake in bold text..please check my friendssss
hopely.jpg (2.15 KiB) Viewed 495 times

User avatar
php-forum Active User
php-forum Active User
Posts: 335
Joined: Tue Feb 22, 2011 8:19 am
Location: Canada

Re: Ask onclick method

Postby freshnet » Tue May 29, 2012 2:39 pm

looks like you're removing that text with this code:

Code: Select all

onfocus=if(this.value =='Quick Search') {this.value = ' ';}

If you don't want it to do this, you should remove this code

Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests