Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Ask onclick method

General discussions related to php

Moderators: macek, egami, gesf

Ask onclick method

Postby dewawira » Mon May 28, 2012 7:36 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...

<?php
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>
</form>
<hr color=#265180></td></tr>";

?>

I think i have a mistake in bold text..please check my friendssss :)
Attachments
hopely.jpg
This is the example picture that i want to have...
hopely.jpg (2.15 KiB) Viewed 168 times
dewawira
New php-forum User
New php-forum User
 
Posts: 3
Joined: Mon May 28, 2012 7:12 pm

Re: Ask onclick method

Postby patilpallavi » Wed Jul 11, 2012 5:00 am

Hi,
Try this one

<input type=text name=kata id=kata class=txt-search >

$('#kata').focus(function(){
var strCurretnSearchString = $(this).val();
if(strCurretnSearchString == "Quick Search");
$(this).val('');
}).blur(function(){
var strCurretnSearchString = $(this).val();
if(strCurretnSearchString == "")
$(this).val('Quick Search');
});

hdmi cables, hdmi Adapters, hdmi Extenders, hdmi Switches
patilpallavi
New php-forum User
New php-forum User
 
Posts: 7
Joined: Wed Jul 04, 2012 11:26 pm


Return to PHP General

Who is online

Users browsing this forum: No registered users and 2 guests

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