|
How To? In Textbox Empty Do Nothing August 06, 2010 06:23AM |
Registered: 2 years ago Posts: 12 |
|
Re: How To? In Textbox Empty Do Nothing August 06, 2010 11:00AM |
Registered: 5 years ago Posts: 361 |
<script type="text/javascript">
<!--
function mySubmit() {
if (document.search.query.value == '') {
alert('Introduce a search term before hitting the Search Button');
return false;
}
}
//-->
</script>
<div>
<form id="search" action="search.php" method="get">
<fieldset>
<input type="text" name="query" maxlength="255" />
<input type="hidden" name="search" value="1" />
<a href="javascript:document.forms['busqueda'].submit()" onclick="return mySubmit()"><input type="submit" value="Search" /></a>
</fieldset>
</form>
</div>
|
Re: How To? In Textbox Empty Do Nothing August 06, 2010 12:32PM |
Registered: 2 years ago Posts: 12 |
|
Re: How To? In Textbox Empty Do Nothing August 06, 2010 12:53PM |
Registered: 5 years ago Posts: 361 |
|
Re: How To? In Textbox Empty Do Nothing August 06, 2010 07:00PM |
Registered: 2 years ago Posts: 12 |
<script type="text/javascript">
<!--
function mySubmit() {
if (document.search.query.value == '') {
return false;
}
}
//-->
</script>
<br /><br /><br /><center>
<table cellpadding="5" cellspacing="1" class="searchBox">
<tr>
<td align="center">
<form action="" method="get" id="search">
<table><tr><td>
<div align="left">
<input type="text" name="query" id="query" size="40" value="<?php print quote_replace($query);?>" action="includes/js_suggest/suggest.php" columns="2" autocomplete="off" delay="1500">
</div>
<td>
<a href="javascript:document.forms['search'].submit()" onclick="return mySubmit()"><input type="image" src="images/artic.gif"></a>
</td></tr>
<tr>
<td>
<center><a href ='?adv=1'>Advanced Search</a></center>
</td>
</tr>
</table>
|
Re: How To? In Textbox Empty Do Nothing August 06, 2010 08:05PM |
Registered: 5 years ago Posts: 361 |
action="includes/js_suggest/suggest.php" columns="2" autocomplete="off" delay="1500"
|
Re: How To? In Textbox Empty Do Nothing August 06, 2010 09:37PM |
Registered: 2 years ago Posts: 12 |
|
Re: How To? In Textbox Empty Do Nothing August 06, 2010 10:10PM |
Registered: 5 years ago Posts: 361 |
|
Re: How To? In Textbox Empty Do Nothing August 06, 2010 10:56PM |
Registered: 3 years ago Posts: 24 |
|
Re: How To? In Textbox Empty Do Nothing August 06, 2010 11:36PM |
Registered: 5 years ago Posts: 361 |
<script type="text/javascript">
<!--
function mySubmit() {
if (document.search.query.value == '') {
alert('Introduce a search term before hitting the Search Button');
return false;
}
}
//-->
</script>
<div>
<form id="search" action="search.php" method="get">
<fieldset>
<input type="text" name="query" maxlength="255" />
<input type="hidden" name="search" value="1" />
<a href="javascript:document.forms['search'].submit()" onclick="return mySubmit()"><input type="submit" value="Search" /></a>
</fieldset>
</form>
</div>
I believe this should work for image button too, if it doesn´t I don't know how to make it work for you, the only thing I can think of is that you should try to change <a href="javascript:document.forms['search'].submit()"into
<a href="javascript:document.forms['search'].image()"but I don't think that'll work.
|
Re: How To? In Textbox Empty Do Nothing August 07, 2010 06:43AM |
Registered: 3 years ago Posts: 24 |