|
-
Aug 20th, 2004, 09:04 PM
#1
Thread Starter
Giants World Champs!!!!
Passing Variables with POST Method
I have a two ASP forms. The fist one has a table which is loaded with data from a sql db. Currently I am using the Get method of passing data from the first form to the second. Now I want to use the Post Method of passing variables between the two forms.
This is my problem the only way I can get this to work is to create a button adjacent to each row in the table and assign the search value as it's name:
VB Code:
<tr>
<td><% =LngCounter %>.</td>
<td><%= mid(rstSimple.Fields("Incident_Type").Value,4)%>  </td>
<td Align = "Center"><%= rstSimple.Fields("Filenum").Value%>  </td>
<td Align = "Center"><%= rstSimple.Fields("CASENUM").Value%>  </td>
<td Align = "Center"><%= rstSimple.Fields("Received_Dt").Value%>  </td>
<td Align = "Center"><%= rstSimple.Fields("STATUS").Value%>  </td>
<td Align = "Center">Not in Mailbox</td>
<td><input type="submit" Name = "INCNUM" value= <% =IncNumber %>></td>
</tr>
INCNUM is the value that I have to pass to the other form in order to access the related data on the second form. I guess I need to add a hidden text box to my form and them some how transfer the value of the selected row's INCNUM to the other form. But I am stumped, any ideas?
Thanks
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Aug 20th, 2004, 09:22 PM
#2
Why are you using Post method?
If you must use Post method, then create a form and have a hidden input field, e.g <input type=hidden name=incnum>
Now use your input button to calll a Javascript function (which will take the INCNUM as parameter), now use javascript to fill the hidden input field and then submit the form.
<input type="submit" Name = "button1" value="JavaScript:Go(<% =IncNumber %>)">
Have a javascript function like :
function Go(Id)
{
document.form1.incnum.value=id;
document.form.submit();
}
That should do it.
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Aug 20th, 2004, 09:29 PM
#3
Thread Starter
Giants World Champs!!!!
Danial
Thanks for the quick post.
Where should I one hidden text box for every row in the table (<input type=hidden name=incnum>? )?
What will appear on the Button Face when I use this method (<input type="submit" Name = "button1" value="JavaScript:Go(<% =IncNumber %> )">)
Have a javascript function like :
function Go(Id)
{
document.form1.incnum.value=id;
document.form.submit();
}
That should do it.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Aug 20th, 2004, 09:39 PM
#4
Originally posted by Mark Gambo
Danial
Thanks for the quick post.
Where should I one hidden text box for every row in the table (<input type=hidden name=incnum>? )?
What will appear on the Button Face when I use this method (<input type="submit" Name = "button1" value="JavaScript:Go(<% =IncNumber %> )">)
Have a javascript function like :
function Go(Id)
{
document.form1.incnum.value=id;
document.form.submit();
}
That should do it.
Sorry there was a mistake. It should have been OnClick instead of Value=...
Here is ........
Code:
<head>
<script>
function Go(id)
{
document.form1.incnum.value=id;
document.form1.submit();
}
</script>
</head>
<html>
<body>
<form name=form1 method=post action="yourTargetFile.asp">
<input type=hidden name=incnum>
<input type=button value="<%=incnum%>" onclick="JavaScript:Go(<%=incnum%>)">
</body>
</html>
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|