Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing an ASP value in a link not working

Status
Not open for further replies.

andycape

Programmer
Aug 22, 2003
177
ZA
I'm trying to have a situation where a asp value is displayed in a box on a form, if there is no value in the database, then a value can be entered, then a link can be clicked and the value passed to the next page.
Is this possible ? as my value is not being passed.
I need it to be passed to the next page so that i can enter it into the database there (if a new value is given), and then on that page i can always select it out of the database with ease.

eg : (the value i'm trying to pass is in textbox "Declined")

<tr>
<td><input type=&quot;text&quot; name=&quot;Declined&quot; value=&quot;<%=RS(&quot;Declined&quot;)%>&quot;></td>
</tr>

<tr bgcolor=&quot;cccccc&quot;>
<td> </td>
<td>A class=&quot;small&quot; HREF=&quot;../Forms/SendMailForm3.asp?MailID=D&quot;>Click here to Decline</A></td>
</tr>
 
hi andycape,
dear ur problem is general . I give the two solution try it:
-----------------------------------------------
1.u have to use java/vb script in this solution
write following code on ur hyperlink:-
<script>
function clickme()
{
var textvalue=[formname].[textboxname].value;

window.location.href=&quot;secondpage.asp?val=&quot; + textvalue;

}
</script>
<a href='clickme();'>clickme</a>
put ur code here for text box in form
-----------------------------------------------
2. Or if u can use button instead of link then make it submit button and give action on the same page
put the following code on top of ur page:

if request(&quot;buttonname&quot;)=&quot;buttonvalue&quot; then
Response.redirect(&quot;secondpage.asp?val=&quot; & Request(&quot;textboxname&quot;))
end if
-----------------------------------------------
u can use either of this solution i think this is sufficient to solve ur problem inform me
Bhoge

 
I'm trying to use a link, a submit button would be too complicated as i have a loop creating the information , so each button would have to pass on different results, so i would need a new form for each loop.

i like the method you are using for the link.
are you sure i must use <a href='clickme();'>clickme</a>

because the link actually thinks its looking for a page called 'clickme(); ?

thanx
 
ok, it should read : javascript: clickme()

but it still isnt picking up the value when i type it into the text box ?

confusing - i cant see why document.myForm.Declined.value dosnt pick up a value when its being typed into the text box. ?? the form and textbox names are correct.
 
hi andycap,
i think u r using textbox in a loop so it can create the control array of the text box don't worry .if my guess is right then
try it : process ur value in loop
for(i=0;i<myform.declined.length;i++)
{
value=value + myform.declined(i).value
//send the value by the same method which i mentioned before
}
it will works.u can explore javascript more...........
don't worry if u r not finding the properties and method on pressing dot after control or form bcos this is common when ur using ASP code inside control.
nothing impossible.
Bhoge
 
If the value is in a form field and you want to pass it then you should have the link submit the form...

<a href=&quot;javascript: document.myForm.submit()&quot;>Submit</a>

What are you trying to do again?

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top