CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Clear Search

Print topic Send  topic

Author Message
Damian Small
Posted: 02/04/2002, 5:20 PM

Any ideas how I could add a clear search button to return entries to initial values. ASP templates.

TIA Damian Small
Nicole
Posted: 02/05/2002, 4:23 AM

Damian,
edit html code and add 'reset' button to search form.
kenlyle
Posted: 02/05/2002, 8:02 AM

Then what, exactly? Does it require Javascript to clear fields? Or just to reload the page? Or is there a hidden event in CC that can be fired just by adding a button with a caption of Reset?

Thanks
kmc
Posted: 02/05/2002, 1:57 PM

Another one that's been on the wish list for a long time.

It surprises me that a CC Search form does not contain a "reset' function by default. Or at least, an option to include a reset/clear button a search form.
Of course we can alter generated code/template, but for such a standard functionality it would be good if it was within the generator's toolset.
Damian Small
Posted: 02/05/2002, 4:12 PM

Added the reset button in HTML.However the reset button clears the form to last search value not the initial value.
example. Item Name in a listbox. Custom Initial value None submit value empty.
Select Item Name in listbox hit reset button None. Select Item Name from Listbox then Search then reset Item Name remains. Any Ideas? Reset appears to reset form to last search not initial value.

TIA Damian Small
Andrew B
Posted: 02/05/2002, 6:08 PM

I remember doing this a while ago. what I did was add another item, and put HTML code in it. Didn't have to edit the .html file.

<input type="reset" value="clear">

I will look for it later, to make sure I am stating it right.
kmc
Posted: 02/06/2002, 2:22 AM

Here's what I usually put into the HTML template , search form section.
<td><input type="button" value="Clear Search" onclick="location.href='ThisPageName.asp'"></td>

This goes exactly above the CC line with it's button.
Adjust the colspan in the CC line.

That refreshes the page OK for me.

Nicole
Posted: 02/06/2002, 2:24 AM

Hello,
Try the following solution. Add Label type field on Search form (lets name it "clear") and select 'HTML' checkbox for it. Make it url link in BeforeShow event:
ASP
fldclear = "<a href = 'Default.asp' name = 'clear'>Clear</a>"
PHP
$fldclear = "<a href = 'Default.php' name = 'clear'>Clear</a>";

To form footer put JavaScript code like:
<script language = "JavaScript">
document.links("clear").onclick = f_clear;

function f_clear()
{
document.Search.bug_name.value = "";
document.Search.bug_id.value = "";
//etc.
return false;
}
</script>

Good luck.
Damian Small
Posted: 02/06/2002, 3:01 PM

Thanks for all the responses, Nicole's Javascript works great. Excellent example. Much appreciated...

Damian Small
Damian Small
Posted: 02/06/2002, 3:17 PM

I tested yours as well kmc it works well and is a very simple solution. I added your code to the caption of a label field changed the name to the name of the page and hey we have a clear search. The caption idea came from Andrew.

Thanks kmc Andrew

Regards Damian Small

Louco
Posted: 03/14/2003, 1:03 PM

This is normal. when you submit a form this put all the code in the HTML. the reset button just works in a non-submited form (flesh form). to clean all a submited form you need to make something in java.
Louco
Posted: 03/14/2003, 1:03 PM

This is normal. when you submit a form this put all the code in the HTML. the reset button just works in a non-submited form (flesh form). to clean all a submited form you need to make something in javascript.
Narendra Kadoo
Posted: 12/07/2003, 7:30 AM

I use CCS 2.0.56. Design a page normally, using the 'Clear' link to clear the search form. When the page is almost finalized, insert a button (named "Clear")next to the 'Search' button. Do NOT assign any Operation, and specify the same page (on which the button was placed) as the 'Return Page'. Click on the 'Clear' link in CCS DESIGN view and copy / cut the 'Remove Parameters' and paste in the Clear BUTTON properties. Choose 'Enable Validation' as No. And that's all, you have a Clear Button! Test it and remove the Clear link!

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.