Hi.
I think I’ve searched the forums but can’t find anything quite like this. Help will be much appreciated.
My problem can be seen online at
[URL=”http://www.orientalrugsonline.co.uk/search.jsp”]http://www.orientalrugsonline.co.uk/search.jsp
The search for size ranges works fine in Mozilla but in IE, it always returns the result for “Large” whichever range you click.
The ranges are 4 <SPAN> elements containing images with onclick events in the jsp:
<span id = ‘lgeSpan’ onmouseover=”this.style.cursor=’pointer'”
onclick=”clearCriteria(”);
submitSizeValues(”,’250′,”,’170′);
“>
<img width=”100″ height=”130″ src=”pics/LargeSearch.jpg” border=”1″>
</img
</span>
<span id = ‘medSpan’ onmouseover=”this.style.cursor=’pointer'”
onclick=”clearCriteria(”);
submitSizeValues(‘255′,’145′,”,’100’);
“>
<img width=”80″ height=”100″ src=”pics/MediumSearch.jpg” border=”1″>
</img
</span>
<span id = ‘smallSpan’ onmouseover=”this.style.cursor=’pointer'”
onclick=”clearCriteria(”);
submitSizeValues(‘150’,”,”,”);
“>
<img width=”55″ height=”70″ src=”pics/SmallSearch.jpg” border=”1″>
</img
</span>
<span id = ‘runSpan’ onmouseover= “this.style.cursor=’pointer'”
onclick=”clearCriteria(”);
submitSizeValues(”,’200′,’110′,’45’);
“>
<img width=”40″ height=”130″ src=”pics/RunnerSearch.jpg” border=”1″>
</img
</span>
Javascript function is
function submitSizeValues(maxL, minL, maxW, minW)
{
document.searchForm.MaxLen.value = maxL;
document.searchForm.MinLen.value = minL;
document.searchForm.MaxWid.value = maxW;
document.searchForm.MinWid.value = minW;
document.searchForm.setSearch.value = ‘Y’;
document.searchForm.submit();
}
Debug analysis – Mozilla
When the code runs in Mozilla (using my local server), I get this debug output on clicking “SMALL” for instance, showing the correct xpath (rugs <= 150 cm long) which finds the correct results from my XML inventory
JUSTIN – searchRes – point 1
SSourceXML: XML/Inventory.xml
SearchHelper bean XPATHL: [L <= 150]
JUSTIN – point 10
In IE, however, for a single click on “SMALL”, I get
JUSTIN – searchRes – point 1
SSourceXML: XML/Inventory.xml
SearchHelper bean XPATHL: [L <= 150]
JUSTIN – point 10
strSource: javax.xml.transform.stream.StreamSource@eaf40c
JUSTIN – searchRes – point 1
SSourceXML: XML/Inventory.xml
SearchHelper bean XPATHL: [L <= 255 and L >= 145 and W >= 100]
JUSTIN – point 10
strSource: javax.xml.transform.stream.StreamSource@5eb489
JUSTIN – searchRes – point 1
SSourceXML: XML/Inventory.xml
SearchHelper bean XPATHL: [L >= 250 and W >= 170]
JUSTIN – point 10
strSource: javax.xml.transform.stream.StreamSource@a522a6
In other words, we have fired the onclick from the current <SPAN> but also the one before (medium) and the one before that so that we always end up with the result from the first (Large). How do I stop these additional onclick events?
Can anyone help, please?