If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Passing an asp value in a link

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-19-03, 05:21
andy_cfc andy_cfc is offline
Registered User
 
Join Date: Jun 2003
Posts: 9
Passing an asp value in a link

I have a select box and then a link, but when i click on the link to go to the next page, the value of the select box is not passed along. can you see what i'm doing wrong ?

thanx.


<table width="90%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="20%"><b>Choose a Store : </b></td>
<td width="80%">
<select style="width:150px;" name="Company">
<%Set RSC = MyClientsConn.Execute("SELECT * FROM Stores")
IF not RSC.EOF then
RSC.MoveFirst
do while Not RSC.eof
If RSC("Code") = "900" Then%>
<option selected value="<%="( "&RSC("Code")&" ) "&RSC("Store")%>"><%=RSC("Store")%></option>
<%Else%>
<option value="<%="( "&RSC("Code")&" ) "&RSC("Store")%>"><%=RSC("Store")%></option>
<%End If
RSC.MoveNext
LOOP
END IF%>
</select>
</td>
</tr>
</table>
<br>
<table width="90%" cellspacing="0" cellpadding="0" border="0">
<A class="yellow" HREF="../PrintableForms/QPHR/ChairpersonsChecklist.asp?Company=<%= request("Company") %>" TARGET="Main2">Chairpersons Checklist</A><br>
</table>
Reply With Quote
  #2 (permalink)  
Old 08-19-03, 18:48
unatratnag unatratnag is offline
Registered User
 
Join Date: Jul 2003
Location: Ohio/Chicago
Posts: 75
what's request("Company")?

do you need a request.querystring?
or request.form?
Reply With Quote
  #3 (permalink)  
Old 08-20-03, 03:32
andy_cfc andy_cfc is offline
Registered User
 
Join Date: Jun 2003
Posts: 9
well request("Company") would give me the value i was looking for if i was on the next page, but it obviously doesnt work when on the same page, I'm looking for an alternative that will pass the value along.
Reply With Quote
  #4 (permalink)  
Old 08-20-03, 06:29
unatratnag unatratnag is offline
Registered User
 
Join Date: Jul 2003
Location: Ohio/Chicago
Posts: 75
Quote:
can you see what i'm doing wrong ?

well request("Company") would give me the value i was looking for if i was on the next page, but it obviously doesnt work when on the same page, I'm looking for an alternative that will pass the value along.
Well next time explain that before hand

<% %> tags mean server side, so when that get's to the browser that field is blank. It's impossible to do that way.

You can set it up in javascript with an onblur or onchange to make some div tag visible and invisible, with the links prepopulated in the tags. I'm not sure of any other method besides this.....this link method is kind of awkward...

is something limiting you from using a submit button? This would allow you to do a querystring or a post for you and would be much better in this situation.......

Last edited by unatratnag; 08-20-03 at 06:32.
Reply With Quote
  #5 (permalink)  
Old 08-20-03, 07:23
andy_cfc andy_cfc is offline
Registered User
 
Join Date: Jun 2003
Posts: 9
I've actually changed it to submit buttons, i just wanted to use links. I'm not sure how to do it in javascript, so i will stick with my submit buttons - thanx !
Reply With Quote
  #6 (permalink)  
Old 08-20-03, 08:35
unatratnag unatratnag is offline
Registered User
 
Join Date: Jul 2003
Location: Ohio/Chicago
Posts: 75
stick with the links if you want to learn something new

it's not really javascript parsay, it's really just manipulating html. Div tags are html, and they have diplay properties, if you were to write out each link of your option box and put each one in a diffent div, you could do somethingl ike this (this is a 2 div example with checkbox, i think you'll get the idea)
Code:
	function div_voda(obj) {
		//if( document.getElementById("hello1").style.display == "none" ) {__ 
	___ if (document.getElementById("broadcast_voda").checked == false ) {
	___		document.getElementById("div1").style.display="inline" 
____	___ document.getElementById("div2").style.display="none" 
___		} else { 
_______		document.getElementById("div1").style.display ="none" 
_______		document.getElementById("div2").style.display="inline" 
___		} 
	}
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On