p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Javascript How-To (http://p2p.wrox.com/forumdisplay.php?f=87)
-   -   Clear Variables (http://p2p.wrox.com/showthread.php?t=30306)

dmerrall June 10th, 2005 07:20 AM

Clear Variables
 
When a user enters values into a search template a second time, they get the results from both the first search and the second search. How can I clear the variables after the first search has been submitted?

Vadivel June 20th, 2005 05:25 AM

I am not too sure whether I have understood your question or not!! Are you storing the search string to a variable? If yes just check whether you are appending to the variable each and every time.

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.blogspot.com
http://vadivel.thinkingms.com

dmerrall June 20th, 2005 08:27 AM

I found code that was appending. I didn't write the original code and don't know why the original author chose to append the code. Once I corrected that, I was fine.

Original Code:

if (document.findform.pagesr.value!="Section"){
     if (document.findform.cites.value!="")
     {
      document.findform.cites.value="+"
     }

Corrected code:
if (document.findform.pagesr.value!="Section"){
     //if (document.findform.cites.value!="")
     {
      document.findform.cites.value="" //+
     }


All times are GMT -4. The time now is 09:54 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.