SPAM-LOW: [thelist] help with javascript

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Fri Oct 29 21:19:53 CDT 2004


Hi Mark,

	Welcome to the list!  It would help if you could tell us what
"doesn't work" means :)  Does it throw an error, and if so, on what
line?

Cheers,

Peter

-----Original Message-----
From: thelist-bounces at lists.evolt.org On Behalf Of Mark Kamian

Hi,

First-time 'thelist' poster here, and a relative newbie with Javascript.
I 
was wondering if anyone could help me figure out why the following JS
works 
with IE 6.0, but not with Mozilla/Netscape...

Thanks in advance!

<% @ Language=VBScript %>
<%
PROP_TYPE = "RES"
If Request.QueryString("PROP_TYPE") <> "" Then
PROP_TYPE = Request.QueryString("PROP_TYPE")
End If

PROP_SUB_T = "SFR"
If Request.QueryString("PROP_SUB_T") <> "" Then
PROP_SUB_T = Request.QueryString("PROP_SUB_T")
End If

OPEN_TYPE = "B"
If Request.QueryString("OPEN_TYPE") <> "" Then
OPEN_TYPE = Request.QueryString("OPEN_TYPE")
End If

openday = UCase(WEEKDAYNAME(theDay))
If Request.QueryString("openday") <> "" Then
openday = Request.QueryString("openday")
End If

%>

<html>
<head>
<title>search page</title>
<script language="javascript">
function opens_BW_on(O_T){
window.location.href="searchopenhomes.asp?OPEN_TYPE="+O_T+"";
}

function opens_resinc_on(O_T,P_T){
window.location.href="searchopenhomes.asp?OPEN_TYPE="+O_T+"&PROP_TYPE="+
P_T+"";
}

function opens_oday_on(O_T,P_T,openday){
var P_S_T
P_S_T = "";
for (var i = 0; i < form1.PROP_SUB_T.length; i++)
if (form1.PROP_SUB_T[i].checked)
P_S_T += form1.PROP_SUB_T[i].value + ",";
if (P_S_T != ""){
P_S_T = P_S_T.substring(0,P_S_T.length - 1);
}
window.location.href="searchopenhomes.asp?OPEN_TYPE="+O_T+"&PROP_TYPE="+
P_T+"&PROP_SUB_T="+P_S_T+"&openday="+openday+"";
}
</script>
</head>
<body>
<form action="searchresults.asp" method="post">
<table>
<tr>
<td>Open Type*:</td>
<td>
<input type="radio" name="OPEN_TYPE" value="W" 
onClick="opens_BW_on('W');">Weekend
<input type="radio" name="OPEN_TYPE" value="B" 
onClick="opens_BW_on('B');">Brokers</td>
</tr>
<tr>
<td>Property Type*:</td>
<td>
<input type="RADIO" name="PROP_TYPE" value="RES" 
onClick="opens_resinc_on('<%= OPEN_TYPE %>','RES');">Residential<br>
<input type="RADIO" name="PROP_TYPE" value="INC" 
onClick="opens_resinc_on('<%= OPEN_TYPE %>','INC');">Multi-Residential 
Income</td>
</tr>
<% If PROP_TYPE = "RES" Then %>
<tr>
<td>&nbsp;</td>
<td>
<input type="checkbox" name="PROP_SUB_T" value="SFR">SFR&nbsp; <input
type="checkbox" name="PROP_SUB_T" value="PUD">PUD&nbsp; <input
type="checkbox" name="PROP_SUB_T" value="CND">COND</td> </tr> <% End If
%> <tr> <td>Open Day*:</td> <td>This Week<br> <input type="RADIO"
name="openday" value="Monday" 
onclick="opens_oday_on('<%= OPEN_TYPE %>','<%= PROP_TYPE 
%>','MONDAY');">MONDAY
<input type="RADIO" name="openday" value="Monday" 
onclick="opens_oday_on('<%= OPEN_TYPE %>','<%= PROP_TYPE 
%>','TUESDAY');">TUESDAY
etc.. through FRIDAY...
</table>
</form>

</body>
</html>




More information about the thelist mailing list