...

View Full Version : Problem with script in FF3 but not IE



AmmO
05-06-2009, 03:27 PM
I have inherited a load of sites that its now my job to update, however the coder before me left no notes and also im not that hot with javascript.

The problem im having is found here

http://www.tech4t.co.uk/territorymapping/prelaunch-go/

I you click on the "show search" you get the search box appearing, then if you enter a full valid postcode e.g "Pe1 2ux" it takes you to the redirect page then to the page you want. This works fine in IE 7 + 8 and used to work fine in older version of FF but for some1 reason it has suddenly stopped working.

Any and all help will be much appreciated because im at my wits end.

_Aerospace_Eng_
05-06-2009, 03:37 PM
Its possible the variables referenced in the script aren't ever getting passed. Change this

<form name="searchform" onSubmit="Search('?srchname='+srchname.value+'&wholewords='+wholewords.checked+'&page=1&onpage=10');return false;">
<label for="text">Search for:</label><input type="text" id="txt" size="30" name="srchname" value=""></input>
<input type="submit" id="btn" value="Search"></input>
<label for="WW">Whole Words</label> <input type="checkbox" id="WW" name="wholewords"></input>
<input type="button" onclick="closebar()" id="showhide" value="Hide"></input>
</form>

to this

<form name="searchform" onSubmit="Search('?srchname='+this.form.srchname.value+'&wholewords='+this.form.wholewords.checked+'&page=1&onpage=10');return false;">
<label for="text">Search for:</label><input type="text" id="txt" size="30" name="srchname" value=""></input>
<input type="submit" id="btn" value="Search"></input>
<label for="WW">Whole Words</label> <input type="checkbox" id="WW" name="wholewords"></input>
<input type="button" onclick="closebar()" id="showhide" value="Hide"></input>
</form>

AmmO
05-06-2009, 03:48 PM
Tried your fix didnt do anything except stop it working in IE

AmmO
05-06-2009, 04:35 PM
appreiate the help aero personally i think is something up with the the redirect function in the JS file inc.js.

Just cant figure out why should it stop working all of a sudden in FF

_Aerospace_Eng_
05-06-2009, 08:37 PM
Try this instead

<form name="searchform" onSubmit="Search('?srchname='+document.forms['searchform'].srchname.value+'&wholewords='+document.forms['searchform'].wholewords.checked+'&page=1&onpage=10');return false;">
<label for="text">Search for:</label><input type="text" id="txt" size="30" name="srchname" value=""></input>
<input type="submit" id="btn" value="Search"></input>
<label for="WW">Whole Words</label> <input type="checkbox" id="WW" name="wholewords"></input>
<input type="button" onclick="closebar()" id="showhide" value="Hide"></input>
</form>
Why they would store an entire database in a js file is beyond me. If it was done properly they would have used a real database of some kind.

AmmO
05-07-2009, 08:55 AM
Thats down to how the the software we use to create the search lookup creates it

AmmO
05-07-2009, 09:00 AM
still no luck im afraid works in IE but not FF

AmmO
05-07-2009, 10:00 AM
any more suggestions would be greatly appreciated, As far as i can tell since IE is performing ok, surely the information is being passed to the function, especially since both browser work fine if you enter in a postcode sector (PE1 2) or postcode district (pe1) with multiple territories assigned to it

AmmO
05-07-2009, 03:12 PM
It also works fine in IE tab but not FF

AmmO
05-07-2009, 04:40 PM
Had a coder friend of mine look at it and hes stumped to think im just gonna have to go with alerts one at a time untill i find something

AmmO
05-07-2009, 05:08 PM
Think ive narrowed down the problem with the settimeout played around with it and got IE to do the same thing as FF

AmmO
05-08-2009, 02:54 PM
manged to get in touch with the guy who wrote the script so hopefully should get a solution soon, if i do ill post here in case any1 else has the same problem

AmmO
05-11-2009, 09:26 AM
Still not heard anything back from the original coder, any help peple will be greatly appreciated.

AmmO
05-14-2009, 02:02 PM
original coder has no clue whats wrong so is redesigning the search functionality

AmmO
05-18-2009, 10:46 AM
The coder says he is going to re-write the way the script re-directs so when he gets back to me hopefully that will be problem solved

AmmO
05-19-2009, 02:49 PM
It was actually quite a nasty fix - All I did was remove the setTimeout() function from the redirecting() function and made it do a straight redirect. Firefox was firing the timeout and then refreshing the page, meaning no redirect.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum