Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #31  
Old June 1st, 2006, 01:49 PM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
ASP Free Expert (3500 - 3999 posts)
 
Join Date: Mar 2005
Location: I used to live at home, now I stay at the house
Posts: 3,514 ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 1 Month 1 Week 4 Days 7 h 1 m 31 sec
Reputation Power: 396
Quote:
Originally Posted by Shadow Wizard
actually, I fear name is essential for client side coding. it's used when refering to the form or frame with such code:
Code:
document.forms["form1"]

as far as I've seen, the name of the form, not its ID, is used to identify it in the forms collection. when would the name attribute be totally deprecated?

It is not essential, it is just one way to do it.

You can just as easily use:
Code:
<form id="f1">
	...
	<input type="text" name="td1" value="Something" />
	...
and access the text box with:
Code:
alert(document.getElementById('f1').td1.value);
// or
alert(document.getElementById('f1').elements['td1'].value);
__________________
Support requests via PM will be ignored!
Route of Queue | The General FAQ Thread | HOW TO POST A QUESTION

Perfectly Impossible - is the eagerly awaited debut release from Jayne Sarah - please buy it - it's really good!


Reply With Quote
  #32  
Old June 19th, 2006, 01:15 PM
jkenne01 jkenne01 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 1 jkenne01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 33 sec
Reputation Power: 0
Code does not work if query results contain " character

Hi - I tried the code today and it works great until I try and populate the drop down boxes with fields that contain the " character - does anyone have a fix for this?

Cheers!

Reply With Quote
  #33  
Old June 20th, 2006, 03:27 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,836 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 13 h 54 m 20 sec
Reputation Power: 2389
this is more of HTML problem - quote in the value generate such HTML:
Code:
<option value="I am "strong" today">1</option>

the HTML define the option value as "I am " only and there's no direct fix for that.
instead, replace the quotes when displaying:
Code:
<option value="<%=Replace(objRS("fieldname"), Chr(34), """)%>">1</option>

this will generate such HTML:
Code:
<option value="I am "strong" today">1</option>

that will be passed correctly, and you can parse the quotes back using Replace again:
Code:
strData = Replace(Request("name"), """, Chr(34)))

Reply With Quote
  #34  
Old June 24th, 2006, 01:08 PM
gjoneshtfc gjoneshtfc is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 6 gjoneshtfc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 25 m 36 sec
Reputation Power: 0
Reduce size of list?

Hello

I have got this working without any trouble so first of all thank you for helping the first person cause it helped me!

However, the dropdown menu contains a lot of options and when you click on it, 30 of them display as the drop down menu expands to the top of the screen. Is there any way to reduce how many items appear in the list at one time?

Thanks for your help,
Regards, Gareth

Reply With Quote
  #35  
Old June 25th, 2006, 02:51 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,836 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 13 h 54 m 20 sec
Reputation Power: 2389
hello Gareth and welcome to aspfree!
the only thing that I'm aware of is the "size" attribute:
Code:
<select name="myselect" size="3">

if that's not what you want, please post new thread in the HTML Forum
and hopefully someone will be able to help.

Reply With Quote
  #36  
Old June 25th, 2006, 05:42 AM
gjoneshtfc gjoneshtfc is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 6 gjoneshtfc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 25 m 36 sec
Reputation Power: 0
Thanks for the welcome and for the reply. Unfortunately i do not have a:

Code:
<select name="myselect" size="3">


in my code because the drop down menus are created by using the function buildLinkedList which uses asp and javascript as in post #2 of this thread. I assume because of this it should not be posted in the HTML forum? Does anyone else have any other ideas?

Thanks again,
Gareth



Quote:
Originally Posted by Shadow Wizard
hello Gareth and welcome to aspfree!
the only thing that I'm aware of is the "size" attribute:
Code:
<select name="myselect" size="3">

if that's not what you want, please post new thread in the HTML Forum
and hopefully someone will be able to help.

Reply With Quote
  #37  
Old June 25th, 2006, 05:52 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,836 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 13 h 54 m 20 sec
Reputation Power: 2389
just add the proper HTML to the ASP code. look where the combo box is generated,
and in there add the size. to find this, open the ASP source code with Notepad.
click F3. search for "<select" (without quotes) and you should find the place where
it's generated. change the "<select" and make it "<select size=3" instead, and
it should change the final HTML output.

Reply With Quote
  #38  
Old June 25th, 2006, 06:25 AM
gjoneshtfc gjoneshtfc is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 6 gjoneshtfc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 25 m 36 sec
Reputation Power: 0
Shadow Wizard,

Thanks for your help... for some reason i couldnt see it! I have made the alterations to the code and it resulted in the box changing from a drop down list to a scrolling list. Is there anything else i can try as i really want it to be a drop down list?

Thanks, Gareth


Quote:
Originally Posted by Shadow Wizard
just add the proper HTML to the ASP code. look where the combo box is generated,
and in there add the size. to find this, open the ASP source code with Notepad.
click F3. search for "<select" (without quotes) and you should find the place where
it's generated. change the "<select" and make it "<select size=3" instead, and
it should change the final HTML output.

Reply With Quote
  #39  
Old June 25th, 2006, 06:41 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,836 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 13 h 54 m 20 sec
Reputation Power: 2389
Quote:
Originally Posted by gjoneshtfc
Shadow Wizard,

Thanks for your help... for some reason i couldnt see it! I have made the alterations to the code and it resulted in the box changing from a drop down list to a scrolling list. Is there anything else i can try as i really want it to be a drop down list?

Thanks, Gareth
that's what I meant by:
Quote:
if that's not what you want, please post new thread in the HTML Forum
and hopefully someone will be able to help.

as far as I know, it's not possible to change the amount of options displayed. however
I'm not HTML guru so maybe there is way - post in the HTML Forum question like
"how to change the amount of options displayed in combo" and hopefully someone
do know of some way for this - if it's possible, it involve HTML or CSS code that you
can insert into the ASP code as I explained before.

Reply With Quote
  #40  
Old June 25th, 2006, 06:50 AM
gjoneshtfc gjoneshtfc is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 6 gjoneshtfc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 25 m 36 sec
Reputation Power: 0
Shadow,

Thanks once again. I will post there and keep my fingers crossed... although I am starting to like the look of the list being a scroll box as it leaves a space which i can fill with another search option. If the company likes the look of it too then I will leave it as a scroll box and my problem is solved!

Thanks for your time,
Regards, Gareth


Quote:
Originally Posted by Shadow Wizard
that's what I meant by:

as far as I know, it's not possible to change the amount of options displayed. however
I'm not HTML guru so maybe there is way - post in the HTML Forum question like
"how to change the amount of options displayed in combo" and hopefully someone
do know of some way for this - if it's possible, it involve HTML or CSS code that you
can insert into the ASP code as I explained before.

Reply With Quote
  #41  
Old July 11th, 2006, 04:31 PM
kjones kjones is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 3 kjones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 32 sec
Reputation Power: 0
How do I pass my selected variables to another page?

This works GREAT! It's the only one of these that I've found that I got to work.

Now, how do I pass the variables that have been selected to another page?

Reply With Quote
  #42  
Old July 12th, 2006, 03:00 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,836 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 13 h 54 m 20 sec
Reputation Power: 2389
just change the action of the form to the URL of the other page.

Reply With Quote
  #43  
Old July 12th, 2006, 02:58 PM
kjones kjones is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 3 kjones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 32 sec
Reputation Power: 0
Re: how do I pass the variables that have been selected to another page?

Quote:
Originally Posted by Shadow Wizard
just change the action of the form to the URL of the other page.


----------------------------------------------

I work mostly in VBScript and so I'm having problems determining how to gather my variables and put them into a querystring to pass in my url to another page. Here's my code:

----------------------------------------------

Code:
'Construct SQL statement
strSQL = "SELECT DISTINCT x.LoanTypeKey, x.type, x.amountKey, y.LoanTypeKey, y.Type, y.amountKey, y.amount FROM tblLoan_rates AS x INNER JOIN tblAmount AS y ON x.amountkey = y.amountkey ORDER BY x.Type ASC, y.amountkey ASC;"
'execute SQL statement to return a recordset
objRS.Open strSQL

'build an array from the recordset using GetRows
arrRS = objRS.GetRows

'close the recordset
objRS.close
set objRS = nothing

'each of the fields from the sql statement will be referenced in the function call
'by their numeric position, starting from 0, so in this example:
'(x) LoanTypeKey = 0
'(x)Type = 1
'(x)AmountKey = 2
'(y) LoanTypeKey = 3
'(y)Type = 4
'(y)AmountKey = 5
'(y)Amount = 6

%>
<style type="text/css">
.width150 {
	width: 150px;
}
</style>
<!--<form id="testform" method="get" action="loan_terms.asp?loantypekey=<%=objRS("LoanTypeKey")%>&amountKey=<%=objRS("AmountKey")%>">-->
<form id="testform" method="get" action="loan_terms.asp?loantypekey=<%=objRS("LoanTypeKey")%>&amountKey=<%=objRS("AmountKey")%>">
<%= buildLinkedList("listLoan",0,1,1,"Select a Loan","width150","listAmount",2,6,1,"Select an Amount","width150") %>
</form>
<%
function buildLinkedList(list1name,list1value,list1text,lis  t1size,list1prompt,list1class,list2name,list2value  ,list2text,list2size,list2prompt,list2class)
	dim strList1, i, strValue, strAssocArr, strAssocArrElem, strList2, strArray, strFunctions
	'build the output for the first list
	strList1 = "<select class='" & list1class & "' name='" & list1name & "' size='" & list1size & "' onchange='getList2(this);'>" & VbCrLf
	strList1 = strList1 & "<option value='' selected='selected'>" & list1prompt & "</option>" & VbCrLf
	for i = 0 to uBound(arrRS,2)
		if arrRS(list1text,i) <> strValue then
			strValue = arrRS(list1text,i)
			strList1 = strList1 & "<option value='" & arrRS(list1value,i) & "'>"
			strList1 = strList1 & arrRS(list1text,i) & "</option>" & VbCrLf
			if len(strAssocArr) > 0 then
				strAssocArr = left(strAssocArr, len(strAssocArr) - 3) & VbCrLf & ");"  & VbCrLf
			end if
			strAssocArr = strAssocArr & "assocArray[""" & list1name & "=" & arrRS(list1value,i) & """] = new Array(" & VbCrLf
			strAssocArr = strAssocArr & """"",""" & list2prompt & """," & VbCrLf
		end if
		strAssocArrElem = """" & arrRS(list2value,i) & """, """ & arrRS(list2text,i) & """," & VbCrLf
		strAssocArr = strAssocArr & strAssocArrElem
	next
	strList1 = strList1 & "</select>" & "<br><br><br>" & VbCrLf
	
	'build the output for the second list
	strList2 = "<select class='" & list2class & "' name='" & list2name & "' size='" & list2size & "'>" & VbCrLf
	strList2 = strList2 & "<option value=''>&nbsp;</option>" & VbCrLf
	strList2 = strList2 & "</select>" & VbCrLf
	
	'build the associative array to populate list 2
	strAssocArr = mid(strAssocArr, 1, len(strAssocArr)-3) & ");"
	strArray = "<script type='text/javascript' language='javascript'>" & VbCrLf
	strArray = strArray & "var assocArray = new Object();" & VbCrLf
	strArray = strArray & strAssocArr & VbCrLf
	
	'build the javascript functions to operate the listboxes
	strFunctions = "function getList2(listOptions){" & VbCrLf
	strFunctions = strFunctions & "  var thisform = listOptions.form;" & VbCrLf
	strFunctions = strFunctions & "  clearDropDown(thisform." & list2name & ");" & VbCrLf
	strFunctions = strFunctions & "  var newvalue = listOptions.name + ""="" + listOptions.options[listOptions.selectedIndex].value;" & VbCrLf
	strFunctions = strFunctions & "  fillDropDown(thisform." & list2name & ", newvalue); // fill the 2nd dropdown options" & VbCrLf
	strFunctions = strFunctions & "}" & VbCrLf
	strFunctions = strFunctions & "function clearDropDown(listOptions){" & VbCrLf
	strFunctions = strFunctions & "  for (var i = listOptions.options.length - 1; i >= 0; i--){" & VbCrLf
	strFunctions = strFunctions & "    listOptions.options[i] = null;" & VbCrLf
	strFunctions = strFunctions & "  }" & VbCrLf
	strFunctions = strFunctions & "  listOptions.selectedIndex = -1;" & VbCrLf
	strFunctions = strFunctions & "}" & VbCrLf
	strFunctions = strFunctions & "function fillDropDown(listOptions, vValue){" & VbCrLf
	strFunctions = strFunctions & "  if (vValue != """" && assocArray[vValue]){" & VbCrLf
	strFunctions = strFunctions & "    var arrX = assocArray[vValue];" & VbCrLf
	strFunctions = strFunctions & "    for (var i = 0; i < arrX.length; i = i + 2){" & VbCrLf
	strFunctions = strFunctions & "      listOptions.options[listOptions.options.length] = new Option(arrX[i + 1], arrX[i]);" & VbCrLf
	strFunctions = strFunctions & "    }" & VbCrLf
	strFunctions = strFunctions & "  } else listOptions.options[0] = new Option("""", """");" & VbCrLf
	strFunctions = strFunctions & "}" & VbCrLf
	strFunctions = strFunctions & "</script>" & VbCrLf
	
	buildLinkedList = strList1 & VbCrLf & strList2 & VbCrLf & strArray & VbCrLf & strFunctions & VbCrLf
end function
%>


------------------------------

I'd like to capture the loantypekey and amountkey selected and put into a querystring to send to another form that will give results based on these selections. I'm having problems with syntax, any help with that? The URL I've used isn't working the way I've written it.

Thanks in advance for any help you can provide!

Last edited by Lafinboy : July 12th, 2006 at 07:33 PM. Reason: Added code block

Reply With Quote
  #44  
Old July 13th, 2006, 01:43 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,836 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2Folding Points: 544103 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 13 h 54 m 20 sec
Reputation Power: 2389
indeed, your syntax is wrong.
change this:
Code:
<form id="testform" method="get" action="loan_terms.asp?loantypekey=<%=objRS("LoanTypeKey")%>&amountKey=<%=objRS("AmountKey")%>">

to be this:
Code:
<form id="testform" method="get" action="loan_terms.asp">

then this:
Code:
<%= buildLinkedList("listLoan",0,1,1,"Select a Loan","width150","listAmount",2,6,1,"Select an Amount","width150") %>

to be this:
Code:
<%= buildLinkedList("loantypekey",0,1,1,"Select a Loan","width150","amountKey",2,6,1,"Select an Amount","width150") %>

having this, the selected values will go to the page loan_terms.asp where you
can read them using Request("loantypekey") and Request("amountKey")

Reply With Quote
  #45  
Old July 13th, 2006, 10:13 AM
kjones kjones is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 3 kjones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 32 sec
Reputation Power: 0
Altering variable in javascript

Thank You! It worked perfectly! One more thing. I'd like to alter the output of one of the fields in the drop down box. I'm not sure where I'd put this in my code...

Here's my vbscript: <%=Replace(RS("Type"),"_"," ")%>

Obviously my type field has some extra stuff in it that I don't want shown to the user. I tried to see if I could do it my sql statement but doesn't look like I can. Below is where it is in the numeric position (1)...

'each of the fields from the sql statement will be referenced in the function call
'by their numeric position, starting from 0, so in this example:
'(x) LoanTypeKey = 0
'(x)Type = 1
'(x)AmountKey = 2
'(y) LoanTypeKey = 3
'(y)Type = 4
'(y)AmountKey = 5
'(y)Amount = 6

This is the only place in my code that I can see where I'm using this numeric position (loantypekey, 0,1,1)...

<%= buildLinkedList("loantypekey",0,1,1,"Select a Loan","width150","amountkey",2,6,1,"Select an Amount","width150") %>

Not sure where or if I can make this change to the type field...Syntax issues with javascript again...

Thanks again for all of your help!

Any javascript reference sites you can recommend?

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Dynamic dependant listboxes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
Stay green...Green IT