|
#1
|
|||
|
|||
|
hi,
i have button on one of my pages, which works perfectly fine in IE, but is dead in Netscape. Any idead why and how to solve this problem?! --- <input type="image" onClick="SetOrder('','')" src="find.gif" width="68" height="24" value="Go" name="submit" alt="search"> -- thanks |
|
#2
|
||||
|
||||
|
Welcome
![]() What is the script that it references?
__________________
Cheers, Degs Please post back with your results CTH Terms of Use CTH Subscriptions :: Adaware Guide :: HijackThis |
|
#3
|
|||
|
|||
|
<script lang="JavaScript">var strProvincesCitiesLocationsForm="search_form";</script>
<!--#include file='ProvincesCitiesLocations.inc'--> <SCRIPT LANGUAGE=javascript> <!-- function GoPage(PageNum) {document.forms('search_form').elements.page.value =PageNum;document.forms('search_form').submit();} function SetOrder(txtOrderBy,txtOrder) {document.forms('search_form').elements.page.value =''; document.forms('search_form').elements.OrderBy.val ue=txtOrderBy; document.forms('search_form').elements.Order.value =txtOrder; document.forms('search_form').submit();} //--> </SCRIPT> <div align=center> <form method="get" action="searchresults.asp" id="search_form" name="search_form"> <INPUT type="hidden" id="OrderBy" name="OrderBy" value="<%=Request.QueryString("OrderBy")%>"> <INPUT type="hidden" id="Order" name="Order" value="<%=Request.QueryString("Order")%>"> <INPUT type="hidden" id="page" name="page" value="<%=Request.QueryString("page")%>"> <select style=width:200px name="ProvinceId" id="ProvinceId" onchange="javascript:ShowCities(this.value);"><opt ion value="0">all provinces</option><%=GetHtmlList("SELECT ProvinceId,ProvinceName FROM tblProvinces","ProvinceId","")%></select><BR> <select style=width:200px name="CityId" id="CityId" onchange="javascript:ShowLocations(this.value);">< option value="0">all cities</option></select><BR> <select style=width:200px name="LocationId" id="LocationId"><option value="0">all locations</option></select><BR> <select style=width:200px name="CottageTypeId" id="CottageTypeId"><option value="0">all types</option><%=GetHtmlList("SELECT CottageTypeId,CottageTypeName FROM tblCottageTypes","CottageTypeId","")%></select><BR> <select style=width:200px name="NumberOfBedrooms" id="NumberOfBedrooms"><option value="">Number of bedrooms</option><%=GetHtmlList2("bachelor,1,2,3,4,4+","")%> </select><BR> </form> <input type="image" onClick="SetOrder('','')" src="images/sb_find.jpg" width="68" height="24" value="Go" name="submit" alt="search"> </div> |
|
#4
|
||||
|
||||
|
try changing forms('search_form') to search_form in all instances.
e.g. document.search_form.elements.page.value
__________________
Cheers, Degs Please post back with your results CTH Terms of Use CTH Subscriptions :: Adaware Guide :: HijackThis |
|
#5
|
|||
|
|||
|
Thanks a lot!!! It works perfectly ... but I have another small problem - my pulldown menu doesn't work in Netscape too
![]() <script lang="JavaScript">var strProvincesCitiesLocationsForm="search_form";</script> <SCRIPT LANGUAGE=javascript> <!-- var ctp=new Array(new Array("4","25","Abbotsford"),new Array("3","9","Airdrie"),new Array("13","75","Ajax"),new Array("15","135","Alma"),new Array("3","10","Athabasca"),new Array("13","76","Aurora"),new Array("13","77","Barrie"),new Array("11","68","Bedford"),new Array("13","78","Belleville"),new Array("15","136","Beloeil"),new Array("13","79","Brampton"),new Array("5","55","Brandon"),new Array("13","80","Brantford"),new Array("13","81","Brockville"),new Array("15","137","Buckingham"),new Array("13","82","Burlington"),new Array("4","26","Burnaby"),new Array("13","83","Caledon"),new Array("3","12","Calgary"),new Array("13","84","Cambridge"),new Array("4","27","Campbell River"),new Array("3","11","Camrose"),new Array("11","67","Cape Breton"),new Array("14","134","Charlottetown"),new Array("15","138","Chateauguay"),new Array("13","85","Chatham-Kent"),new Array("4","28","Chilliwack"),new Array("13","86","Clarington"),new Array("4","29","Coquitlam"),new Array("9","64","Corner Brook"),new Array("13","87","Cornwall"),new Array("4","30","Courtenay"),new Array("11","69","Dartmouth"),new Array("4","31","Delta"),new Array("15","139","Drummondville"),new Array("4","32","Duncan"),new Array("3","13","Edmonton"),new Array("3","14","Fort McMurray"),new Array("8","58","Fredericton"),new Array("15","140","Gatineau-Hull"),new Array("13","88","Georgina"),new Array("15","141","Granby"),new Array("3","15","Grande Prairie"),new Array("13","89","Greater Sudbury"),new Array("13","90","Guelph"),new Array("13","91","Haldimand"),new Array("11","70","Halifax"),new Array("13","92","Halton Hills"),new Array("13","93","Hamilton"),new Array("12","74","Iqaluit"),new Array("15","142","Joliette"),new Array("4","33","Kamloops"),new Array("13","94","Kawartha Lakes"),new Array("4","34","Kelowna"),new Array("11","71","Kentville"),new Array("13","95","Kingston"),new Array("13","96","Kitchener"),new Array("3","16","Lacombe"),new Array("3","17","Lakeland"),new Array("4","35","Langley"),new Array("15","143","Laval"),new Array("13","97","Leamington"),new Array("3","18","Lethbridge"),new Array("15","144","Levis"),new Array("3","19","Lloydminster"),new Array("13","98","London"),new Array("15","145","Longueuil"),new Array("4","36","Maple Ridge"),new Array("13","99","Markham"),new Array("3","20","Medicine Hat"),new Array("13","100","Midland"),new Array("13","101","Milton"),new Array("13","102","Mississauga"),new Array("8","59","Moncton"),new Array("15","146","Montreal"),new Array("16","166","Moose Jaw"),new Array("4","37","Nanaimo"),new Array("11","72","New Minas"),new Array("4","38","New Westminster"),new Array("13","103","Newmarket"),new Array("13","104","Niagara Falls"),new Array("13","105","Norfolk"),new Array("13","106","North Bay"),new Array("4","39","North Vancouver"),new Array("13","107","Oakville"),new Array("13","108","Orangeville"),new Array("13","109","Orillia"),new Array("13","110","Oshawa"),new Array("13","111","Ottawa"),new Array("5","56","Otterburne"),new Array("13","112","Owen Sound"),new Array("4","40","Parksville"),new Array("13","113","Pembroke"),new Array("4","41","Penticton"),new Array("13","114","Peterborough"),new Array("13","115","Pickering"),new Array("4","42","Port Alberni"),new Array("4","43","Port Coquitlam"),new Array("16","167","Prince Albert"),new Array("4","44","Prince George"),new Array("15","147","Quebec"),new Array("13","116","Quinte West"),new Array("3","21","Red Deer"),new Array("16","168","Regina"),new Array("4","45","Richmond"),new Array("13","117","Richmond Hill"),new Array("15","148","Rimouski"),new Array("15","149","Rouyn-Noranda"),new Array("4","46","Saanich"),new Array("11","73","Sackville"),new Array("8","60","Sackville"),new Array("15","150","Saguenay"),new Array("8","61","Saint John"),new Array("15","151","Saint-Eustache"),new Array("15","152","Saint-Georges"),new Array("15","153","Saint-Hyacinthe"),new Array("15","154","Saint-Jean-sur-Richelieu"),new Array("15","155","Saint-Jerome"),new Array("15","156","Salaberry-de-Valleyfield"),new Array("13","118","Sarnia"),new Array("16","169","Saskatoon"),new Array("13","119","Sault Ste. Marie"),new Array("13","120","Scarborough"),new Array("15","157","Sept-Iles"),new Array("15","158","Shawinigan"),new Array("15","159","Sherbrooke"),new Array("15","160","Sorel-Tracy"),new Array("4","47","Squamish"),new Array("3","22","St. Albert"),new Array("13","121","St. Catharines"),new Array("9","65","St. John's"),new Array("8","62","St. Stephen"),new Array("13","122","St. Thomas"),new Array("13","123","Stratford"),new Array("3","23","Strathcona County"),new Array("13","124","Sudbury"),new Array("4","48","Surrey"),new Array("8","63","Sussex"),new Array("15","161","Terrebonne"),new Array("15","162","Thetford Mines"),new Array("13","125","Thunder Bay"),new Array("13","126","Timmins"),new Array("13","127","Toronto"),new Array("15","163","Trois-Rivieres"),new Array("15","164","Val-d'Or"),new Array("4","49","Vancouver"),new Array("13","128","Vaughan"),new Array("4","50","Vernon"),new Array("4","51","Victoria"),new Array("15","165","Victoriaville"),new Array("4","52","Walnut Grove"),new Array("13","129","Waterloo"),new Array("13","130","Welland"),new Array("4","53","West Vancouver"),new Array("13","131","Whitby"),new Array("4","54","White Rock"),new Array("17","170","Whitehorse"),new Array("13","132","Windsor"),new Array("5","57","Winnipeg"),new Array("3","24","Wood Buffalo"),new Array("13","133","Woodstock"),new Array("10","66","Yellowknife")); /////////////////////////////// var ltc=new Array(new Array("57","24","Central"),new Array("70","32","Central"),new Array("12","9","Central"),new Array("13","14","Central"),new Array("127","40","Central"),new Array("111","36","Downtown"),new Array("49","21","Downtown"),new Array("168","44","Downtown"),new Array("111","38","East"),new Array("127","41","East"),new Array("49","23","East Side"),new Array("127","42","North"),new Array("70","35","North"),new Array("57","27","North East"),new Array("168","45","North East"),new Array("12","10","North East"),new Array("13","15","North East"),new Array("12","11","North West"),new Array("13","16","North West"),new Array("168","46","North West"),new Array("57","26","North West"),new Array("57","31","Rural"),new Array("168","48","South"),new Array("70","33","South"),new Array("111","39","South"),new Array("57","29","South"),new Array("13","17","South East"),new Array("168","47","South East"),new Array("12","12","South East"),new Array("57","28","South East"),new Array("12","13","South West"),new Array("13","18","South West"),new Array("57","30","South West"),new Array("13","20","St. Albert"),new Array("13","19","West"),new Array("111","37","West"),new Array("127","43","West"),new Array("57","25","West"),new Array("70","34","West"),new Array("49","22","West Side")); /////////////////////////// function ShowCities(ProvinceId) { var CityList=document.forms(strProvincesCitiesLocation sForm).elements('CityId'); while (CityList.options.length>0) {CityList.options.remove(0);} var newOption=new Option('all cities','0');CityList.options.add(newOption); for (n=0;n<ctp.length;n++) {if (ctp[n][0]==ProvinceId || ProvinceId==0) {var newOption=new Option(ctp[n][2],ctp[n][1]);CityList.options.add(newOption);} } ShowLocations(); } function ShowLocations(CityId) { var LocationsList=document.forms(strProvincesCitiesLoc ationsForm).elements('LocationId'); while (LocationsList.options.length>0) {LocationsList.options.remove(0);} var newOption=new Option('all locations','0');LocationsList.options.add(newOptio n); for (n=0;n<ltc.length;n++) { if (ltc[n][0]==CityId || CityId==0) {var newOption=new Option(ltc[n][2],ltc[n][1]);LocationsList.options.add(newOption);} } } //--> </SCRIPT> <SCRIPT LANGUAGE=javascript> <!-- function GoPage(PageNum) // ... same script as above thanks |
|
#6
|
||||
|
||||
|
Hi,
that it a lot of code ![]() I can only suggest a similar method of changing document.forms to something else. if you have IDs set then try document.search_form or document.getElementById('idname')
__________________
Cheers, Degs Please post back with your results CTH Terms of Use CTH Subscriptions :: Adaware Guide :: HijackThis |
|
#7
|
|||
|
|||
|
hi tried both ...
document.search_form doesn't work both in IE and Netscape (may be i did something wrong) document.getElementById('idname') works only in IE any other ideas??? thanks
|
|
#8
|
|||
|
|||
|
Is the select element not getting populated with options or is it not working when you select an option?
if it's the former then you could document.write() the select tag and then from your loop document.write out each of the option tags. Alternatively this looks like something that would work very nicely as a database with a server side script.
__________________
Don't forget to post back with the results |
![]() |
| Bookmarks |
«
Previous Topic
|
Next Topic
»
| Topic Tools | |
|
|
All times are GMT +1. The time now is 08:24 AM.
[
RSS ]











