473,320 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

client side dynamic dependent list box

Hi there,

Was hoping someone would have an fix for me or some kind or work around. I
was able to get my client side dynamic dependent list box working but if
my child list data has double quotes or hard breaks as values it wont work
at all and I am getting a "underterminated string constant" error.

If anyone can help please email me at: ai**********@pembinatrails.ca

thanks in andvance
Nov 18 '05 #1
3 2045
code plz

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Amp Inthalangsy" <Ai**********@pembinatrails.ca> wrote in message
news:uN**************@TK2MSFTNGP11.phx.gbl...
Hi there,

Was hoping someone would have an fix for me or some kind or work around. I
was able to get my client side dynamic dependent list box working but if
my child list data has double quotes or hard breaks as values it wont work
at all and I am getting a "underterminated string constant" error.

If anyone can help please email me at: ai**********@pembinatrails.ca

thanks in andvance

Nov 18 '05 #2
<!--

var arrDynaList = new Array();
var arrDL1 = new Array();

arrDL1[1] = "personal_category"; // Name of parent list box
arrDL1[2] = "form1"; // Name of form containing parent list box
arrDL1[3] = "dropdownbox"; // Name of child list box
arrDL1[4] = "form1"; // Name of form containing child list box
arrDL1[5] = arrDynaList; // No need to do anything here

<%
Dim txtDynaListRelation, txtDynaListLabel, txtDynaListValue, oDynaListRS

txtDynaListRelation = "category" ' Name of recordset field relating to
parent
txtDynaListLabel = "label" ' Name of recordset field for child Item
Label
txtDynaListValue = "comment" ' Name of recordset field for child Value
Set oDynaListRS = personalcomments ' Name of child list box recordset

Dim varDynaList
varDynaList = -1

Dim varMaxWidth
varMaxWidth = "1"

Dim varCheckGroup
varCheckGroup = oDynaListRS.Fields.Item(txtDynaListRelation).Value

Dim varCheckLength
varCheckLength = 0

Dim varMaxLength
varMaxLength = 0

While (NOT oDynaListRS.EOF)

If (varCheckGroup <> oDynaListRS.Fields.Item(txtDynaListRelation).Value )
Then
If (varCheckLength > varMaxLength) Then
varMaxLength = varCheckLength
End If
varCheckLength = 0
End If
%>
arrDynaList[<%=(varDynaList+1)%>] =
"<%=(oDynaListRS.Fields.Item(txtDynaListRelation). Value)%>"
arrDynaList[<%=(varDynaList+2)%>] =
"<%=(oDynaListRS.Fields.Item(txtDynaListLabel).Val ue)%>"
arrDynaList[<%=(varDynaList+3)%>] =
"<%=(oDynaListRS.Fields.Item(txtDynaListValue).Val ue)%>"
<%
If (len(oDynaListRS.Fields.Item(txtDynaListLabel).Val ue) >
len(varMaxWidth)) Then
varMaxWidth = oDynaListRS.Fields.Item(txtDynaListLabel).Value
End If
varCheckLength = varCheckLength + 1
varDynaList = varDynaList + 3
oDynaListRS.MoveNext()
Wend

If (varCheckLength > varMaxLength) Then
varMaxLength = varCheckLength
End If
%>

//-->
</script>
<script language="JavaScript">
<!--
function setDynaList(arrDL){

var oList1 = document.forms[arrDL[2]].elements[arrDL[1]];
var oList2 = document.forms[arrDL[4]].elements[arrDL[3]];
var arrList = arrDL[5];

clearDynaList(oList2);

if (oList1.selectedIndex == -1){
oList1.selectedIndex = 0;
}

populateDynaList(oList2, oList1[oList1.selectedIndex].value, arrList);
return true;
}

function clearDynaList(oList){

for (var i = oList.options.length; i >= 0; i--){
oList.options[i] = null;
}

oList.selectedIndex = -1;
}

function populateDynaList(oList, nIndex, aArray){
oList[oList.length]= new Option("Please Select");
for (var i = 0; i < aArray.length; i= i + 3){
if (aArray[i] == nIndex){
oList.options[oList.options.length] = new Option(aArray[i + 1], aArray[i
+ 2]);
}

}
if (oList.options.length == 1){
oList.options[oList.options.length] = new Option("No personal comments for
this category");
}
oList.selectedIndex = 0;
}

//-->
</script>

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl...
code plz

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Amp Inthalangsy" <Ai**********@pembinatrails.ca> wrote in message
news:uN**************@TK2MSFTNGP11.phx.gbl...
Hi there,

Was hoping someone would have an fix for me or some kind or work around. I was able to get my client side dynamic dependent list box working but if my child list data has double quotes or hard breaks as values it wont work at all and I am getting a "underterminated string constant" error.

If anyone can help please email me at: ai**********@pembinatrails.ca

thanks in andvance


Nov 18 '05 #3
Amp Inthalangsy wrote:
[...]

I doesn't make any sense that you crosspost in newsgroup of different
languages.
For example in microsoft.public.it.dotnet.asp you should post into Italian
language!

--
Raffaele Rialdi
Microsoft .NET MVP http://mvp.support.microsoft.com -
http://italy.mvps.org UGIdotNET - User Group Italiano .NET
http://www.ugidotnet.org Weblog: http://blogs.ugidotnet.org/raffaele

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: MonkeyBoy | last post by:
I am doing some some HTML manipulation in client-side script (IE5.x and IE6.x browsers only). Something like.. var tmpHTML = oTable.outerHTML // do something to the HTML her oTable.outerHTML =...
2
by: Tim Johnson | last post by:
Hi All: I have recently (with the invaluable help of this newsgroup) learned how to provide dynamic html using client-side Javascript. I have a happy and excited customer. Well, I'm happy that...
4
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times....
33
by: Todd | last post by:
OK, I created a .htm page within a new Web solution: -------------------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head>...
9
by: Jerry | last post by:
In limiting textbox input to 500 characters I would like to include a dynamic count of characters input while the user is typing into a textbox. This would obviously be a client side control,...
6
by: Valerian John | last post by:
I have a ListBox webcontrol on an aspx page. Items are added to the ListBox using client-side code. However, when the page is posted back the items are missing/not available. (It is like the...
5
by: Kursat | last post by:
Hi, I want to add new collapsable panel items using java script at client side. Is this possible to create Ajax components like collapsable panel without server round trip? Thanks in advance.
22
by: Dan Rumney | last post by:
Hi all, I've been writing Javascript for quite a while now and have, of late, been writing quite a lot of AJAX and AJAX-related code. In the main, my dynamically generated pages are created...
1
by: jmartmem | last post by:
Greetings, I have a nagging problem with client-side dynamic dependent list boxes that perhaps someone can help me troubleshoot. I have a form with a series of dynamic dependent list boxes....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.