Welcome to Dream.In.Code
Become an Expert!

Join 150,390 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,089 people online right now. Registration is fast and FREE... Join Now!




ASP Sending Variables in VB given a form

 
Reply to this topicStart new topic

ASP Sending Variables in VB given a form

meighlow
7 Mar, 2008 - 04:57 PM
Post #1

New D.I.C Head
*

Joined: 27 Jan, 2008
Posts: 15

Hello all,

I am attempting to send 2 vars cid and coId with a form to another page. However, I cant figure out how to transmit them. On the page that receives, process_job.asp I am using request.form to another variable 'job_title. How can I get the others since they are in VB between <% %>tags? I tried appending them to the line:
CODE
<form method="post" action="process_job.asp" >

but it wouldnt allow it. I need to transmit these values so they may be entered in the table on the next page as foreign keys.

Thanks- Meighlow

CODE


dim cid , coId ' how do I get these to the next page
dim sql, rs
set cid = (Request.QueryString("con_id"))  
  
sql = "SELECT * FROM CONTACT, COMPANY WHERE ContactId =" & cid  & "and CompId=CompanyId"

set rs = Server.CreateObject("ADODB.Recordset")

rs.open sql, Conn

coId=rs("CompId")
%>


<form method="post" action="process_job.asp" >
<table width="100%">

    <tr>
        <td>Position:</td>
        <td><input type=text name="job_title"></td>
    </tr>
    <tr>
        <td colspan=2>
        <center><input type=Submit value="REGISTER"></center>            
        </td>
    </tr>

</table>
</form>



This post has been edited by meighlow: 7 Mar, 2008 - 05:48 PM
User is offlineProfile CardPM
+Quote Post

bhandari
RE: ASP Sending Variables In VB Given A Form
7 Mar, 2008 - 05:01 PM
Post #2

D.I.C Addict
Group Icon

Joined: 31 Jan, 2008
Posts: 747


Dream Kudos: 900
My Contributions
meighlow, can you please edit your post and used code.gif
User is offlineProfile CardPM
+Quote Post

meighlow
RE: ASP Sending Variables In VB Given A Form
7 Mar, 2008 - 08:43 PM
Post #3

New D.I.C Head
*

Joined: 27 Jan, 2008
Posts: 15

Should I use a cookie to pass the data or is that weak?
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: ASP Sending Variables In VB Given A Form
8 Mar, 2008 - 03:54 PM
Post #4

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
From looking at your code, in your form you only have a single form element, a TextBox named job_title, if you don't have fields for the 2 you wish to pass there is no way to get them there, because they simply don't exist. Because the only element you have is the job title box that is the only thing you can pass to another string.

Now if those 2 items are passed to this page then you can hide them in a hidden form element, but I dont even see where you're passing them to this page. To get the job title on the next page, the way you have it now, would be


vb

Dim title As String
title = Request.Form("job_title")


That is because your method type is POST. If you were insistent on sending them through the QueryString you would have to change the method to GET
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 05:28PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month