i just write code for select option in combo box which i m select but when i press search button and then click on back button then there in no option selected. and that same code working in ie7 and firefox so plz any 1 suggest me soluction quickly..
3 1934
Can you post your code please.
Can you post your code please.
- <%
-
set dataConnection = Server.CreateObject("ADODB.Connection")
-
dataConnection.Open MAIN_DSN
-
-
sqlQuery = "EXEC sp_getCategories NULL"
-
set categoriesRS = dataConnection.Execute(sqlQuery)
-
-
if (not(categoriesRS.BOF and categoriesRS.EOF)) then
-
arrCategoriesDB = categoriesRS.GetRows()
-
-
arrcount = 0
-
for each fieldValue in categoriesRS.fields
-
fieldName = fieldValue.Name
-
Execute("fld_" & fieldName & " = arrcount")
-
arrcount = arrcount + 1
-
next
-
-
numCategoriesRows=ubound(arrCategoriesDB,2)
-
end if
-
-
set categoriesRS = nothing
-
-
firstCat1 = ""
-
if (thisCategoryID <> "") then
-
sqlQuery = "EXEC sp_getCategories " & thisCategoryID
-
set pathRS = dataConnection.Execute(sqlQuery)
-
-
index=0
-
for x=1 to 4
-
if (pathRS("CategoryID" & x) <> 0) then
-
index = index + 1
-
Execute("firstCat" & index & " = pathRS(""CategoryID" & x & """)")
-
end if
-
next
-
-
set pathRS = nothing
-
end if
-
-
' Function to create the a list of code for dynamic drop down javascript
-
function javaArray()
-
-
prevCat = ""
-
for rowcounter = 0 to numCategoriesRows
-
if (arrCategoriesDB(fld_CategoryID3,rowcounter) <> prevCat) then
-
prevCat = arrCategoriesDB(fld_CategoryID3,rowcounter)
-
strQuery = strQuery & "arrCat[" & prevCat & "] = """
-
-
for rowcounter2 = 0 to numCategoriesRows
-
if (arrCategoriesDB(fld_CategoryID3,rowcounter2) = prevCat) then
-
strQuery = strQuery & arrCategoriesDB(fld_CategoryName4,rowcounter2) & "#" & arrCategoriesDB(fld_CategoryID4,rowcounter2) & "||"
-
end if
-
next
-
-
strQuery = strQuery & """;"
-
end if
-
next
-
-
javaArray = strQuery
-
end function
-
-
%>
-
<script language="javascript">
-
var arrCat = new Array();
-
<%= javaArray() %>
-
function mmChangeContact(objFldParent,objFldChild, contact_caption)
-
{
-
var ContactList = arrCat[<%= firstCat1 %>];
-
clearList(objFldChild);
-
addElement(objFldChild, contact_caption, "");
-
-
if(ContactList)
-
{
-
-
var rgContacts = ContactList.split('||');
-
-
addElement(objFldChild, "Select All", "ALL");
-
for (var i = 0; i < rgContacts.length; i++)
-
{
-
if (rgContacts[i])
-
{
-
var rgContact = rgContacts[i].split('#');
-
addElement(objFldChild, rgContact[0], rgContact[1]);
-
}
-
}
-
-
objFldChild.disabled = false;
-
}
-
else
-
{
-
objFldChild.disabled = true;
-
}
-
-
//objFldChild.selectedIndex = 0;
-
-
}
-
-
function clearList(list)
-
{
-
var i = 0;
-
var o = list.options;
-
-
for (i = o.length; i >= 0; --i)
-
o[i] = null;
-
list.disabled = true;
-
}
-
-
function addElement(list, text_in, value_in)
-
{
-
var o = list.options;
-
var nIdx;
-
-
if (o.length < 0) //IE for Mac 4.5 sets length to -1 if list is empty
-
nIdx = 0;
-
else
-
-
nIdx = o.length;
-
-
o[nIdx] = new Option(text_in, value_in);
-
list.disabled = false;
-
}
-
-
function setDefaultByText(list, text_in)
-
{
-
with (list)
-
{
-
for (var i = 0; i < (options.length); i++)
-
{
-
if (options[i].text == text_in)
-
{
-
selectedIndex = i;
-
return;
-
}
-
}
-
}
-
}
-
-
function setDefaultByValue(list, value_in)
-
{
-
with (list)
-
{
-
for (var i = 0; i < (options.length); i++)
-
{
-
if (options[i].value == value_in)
-
{
-
selectedIndex = i;
-
return;
-
}
-
}
-
}
-
}
-
-
function validate(){
-
var objFld = document.EDITPRODUCT
-
var flagAffiliate = 0
-
-
if (objFld.Parent1.value != "")
-
{
-
objFld.CategoryID.value = objFld.Parent1.value
-
flagAffiliate = 1
-
}
-
-
if (objFld.Parent1.value == "")
-
{
-
alert("Please Select a Make");
-
return false;
-
}
-
/*if (objFld.Child.value == "")
-
{
-
alert("Please Choose a Vehicle Model");
-
return false;
-
}
-
if (objFld.GrandChild.value == "")
-
{
-
alert("Please Choose a Vehicle Model");
-
return false;
-
}*/
-
-
return true;
-
}
-
</script>
-
<%
-
if (Cint(catID) = CARS) then
-
MakeImage = "/auto_classifieds_images/sh_make.gif"
-
elseif (Cint(catID) = TRUCKS) then
-
MakeImage = "/auto_classifieds_images/sh_make.gif"
-
elseif (Cint(catID) = MOTORCYCLES) then
-
MakeImage = "/auto_classifieds_images/sh_make.gif"
-
elseif (Cint(catID) = BOATS) then
-
MakeImage = "/auto_classifieds_images/sh_boat.gif"
-
elseif (Cint(catID) = RVS) then
-
MakeImage = "/auto_classifieds_images/sh_make.gif"
-
elseif (Cint(catID) = SPECIALTY) then
-
MakeImage = "/auto_classifieds_images/sh_specialty.gif"
-
end if
-
%>
-
<input type="hidden" name="CategoryID" value="">
-
<tr>
-
<td width="100" align="right"><img src="<%= MakeImage %>" width="90" height="28" border="0"></td>
-
<td width="200"><select name="Parent1">
-
<option value="">----------- Select One -----------</option>
-
<option value="ALL">Select ALL</option>
-
<%
-
for rowcounter = 0 to numCategoriesRows
-
if (arrCategoriesDB(fld_CatParent4,rowcounter) = 0) then
-
selectThis = ""
-
if ( arrCategoriesDB(fld_CategoryID4,rowcounter) = firstCat1) then
-
selectThis = "selected"
-
end if
-
-
if arrCategoriesDB(fld_CategoryID4,rowcounter) <> 0 then
-
%>
-
<option value="<%= arrCategoriesDB(fld_CategoryID4,rowcounter) %>" <%=selectThis%>><%= arrCategoriesDB(fld_CategoryName4,rowcounter) %></option>
-
<%
-
end if
-
end if
-
next
-
%>
-
</select></td>
-
</tr>
-
<script language="javascript">
- <%
-
if (firstCat1 <> "") then
-
%>
-
mmChangeContact(document.EDITPRODUCT.Parent1,document.EDITPRODUCT.Parent1, '----------- Select One -----------');
-
setDefaultByValue(document.EDITPRODUCT.Parent1,'<%= firstCat1 %>')
-
<%
-
end if
-
-
if (firstCat2 <> "") then
-
%>
-
mmChangeContact(document.EDITPRODUCT.Parent1,document.EDITPRODUCT.Child, '----------- Select One -----------');
-
setDefaultByValue(document.EDITPRODUCT.Child,'<%= firstCat2 %>')
-
<%
-
end if
-
-
if (firstCat3 <> "") then
-
%>
-
mmChangeContact(document.EDITPRODUCT.Child,document.EDITPRODUCT.GrandChild, '----------- Select One -----------');
-
setDefaultByValue(document.EDITPRODUCT.GrandChild,'<%= firstCat3 %>')
-
<%
-
end if
-
-
if (firstCat4 <> "") then
-
%>
-
mmChangeContact(document.EDITPRODUCT.GrandChild,document.EDITPRODUCT.GreatGrandChild, '----------- Select One -----------');
-
setDefaultByValue(document.EDITPRODUCT.GreatGrandChild,'<%= firstCat4 %>')
-
<%
-
end if
-
%>
-
-
</script>
Can you post the generated client-side source code instead (using code tags please).
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Gregory Piñero |
last post by:
Hi guys,
I'm trying to run this statement:
os.system(r'"C:\Program Files\Mozilla Firefox\firefox.exe"' + '
"www.blendedtechnologies.com"')
The goal is to have firefox open to that website....
|
by: The Bicycling Guitarist |
last post by:
http://www.TheBicyclingGuitarist.net/css/index.css
I have red nav buttons that turn blue when hovered over and turn purple
after being visited. The red and blue work in FireFox, but not the visited...
|
by: Mark Olbert |
last post by:
The doPostBack javascript functioning is not submitting the page when called by linkbuttons (or an
autopostback checkbox, for that matter).
I'm aware of a problem with Netscape browsers and the...
|
by: Coder |
last post by:
Hi I have the following code in java script, it is not giving proper
output in FIREFOX but running fine in IE... can anybody help me out to
make this run in FIREFOX .
<script...
|
by: ajaysoniji |
last post by:
Hi,
I am using this code to read the option values from a select option. I am getting the reference of that select option in arg1. Its working fine with mozilla firefox but not with Internet...
|
by: javakid |
last post by:
Hi
Following form validatioin code is working fine on IE but not working on Mozilla Firefox V2.
Can any body suggest?
Regards
<script ="JAVASCRIPT" type="text/javascript">...
|
by: CoolForU |
last post by:
this is my code and i call this code from code behinde file on page load
like this
useragree.Attributes.Add("onclick", "CheckSelection();")
this is working fine with IE but not working with...
|
by: rajasree |
last post by:
Hi all,
am doing a project in PHP. my javascript code is working properly in ie. But its not working in firefox. Please help me
my code is as follows;
<script language="javascript"...
|
by: Sura |
last post by:
Hi
I have a flash interactive window which has html links and this
appears on an html page. This window can be moved with the mouse on
the html page. The html page has an iFrame too. When the...
|
by: Jenitha S |
last post by:
Hi,
I am working in JSP code.A Menubar is displayed in JSP page.It's working fine in IE. But in case of firefox the very first menuitem is not working.If i move that menu item as second means it's...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |