Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2003
    Posts
    9

    Unanswered: 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>

  2. #2
    Join Date
    Jul 2003
    Location
    Ohio/Chicago
    Posts
    75
    what's request("Company")?

    do you need a request.querystring?
    or request.form?

  3. #3
    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.

  4. #4
    Join Date
    Jul 2003
    Location
    Ohio/Chicago
    Posts
    75
    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 07:32.

  5. #5
    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 !

  6. #6
    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" 
    ___		} 
    	}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •