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

 Creating a 'Clear Search' button on search forms

Print topic Send  topic

Author Message
Andrew B
Posted: 04/08/2002, 6:37 PM

Place this code in your search form's 'open' event. It assumes thus :

1. The search form is named 'Search'
2. The search button is still labeled 'Search'

If this is not the case, modify the lines 'ToReplace' and 'ReplaceWith' to match what you want to be displayed.

sFormName = "FormSearch"
ToReplace = "<input type=""submit"" value=""Search"">"
ReplaceWith = ToReplace & " <input type=""button"" value=""Clear"" onclick=""window.location='" & sActionFileName & "'"">"
DBlocks(sFormName) = Replace(DBlocks(sFormName), ToReplace, ReplaceWith)

If you need more help, just post up here.

i know i know i know! I could have used RegEx but I was lazy :)
Artur
Posted: 04/09/2002, 1:46 AM

Hi,
I've also seen simple solution for the same problem in the article:
http://www.gotocode.com/art.asp?art_id=134&
But there's link is used, not button
Andrew B
Posted: 04/09/2002, 3:34 PM

Well, that does things a bit differently than mine, which simply reloads the page. The problem with that way is that it just resets the form to whatever values were in it at the beginning. If you load up a form with value="" already set for the input boxes, reset just reverts to that value, not blank.

Also, I wanted a pretty button that was inside the search box and not the hacks I had used before with fake columns.

This one works by actually modifying the HTML that CC loaded from the template.
Al Cole
Posted: 11/03/2002, 3:16 PM

Thanks for your post for the simple site I am making this works great.

Al
feha
Posted: 11/04/2002, 12:48 AM

PHP ?
Even if reset function is used the form remembers submited values ...

   


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

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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