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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difficult value pass 2

Status
Not open for further replies.

welldefined

Programmer
Mar 9, 2006
62
GB
Hi,

Current page is:

<form action="Next.asp" method="post">
<input type="text" value="abc" name="input1">
<input type="submit">
</form>
<a htef="Next.asp">Next</a>

After click the submit button, <input type="submit">, we go to next page, Next.asp, and we can get the value "abc" by
request.form("input1")
If click the tag <a htef="Next.asp">Next</a>, we can also go to page Next.asp, but how to get the value "abc"??(without using querystring nor cookies)
 
Not likely unless your click event uses script to submit a form.

htef ?

 
Session variable?

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Sheco,

"uses script to submit a form"? That is very interesting.
Can you show me how to do that by click the tag <a....>

 
johnwm,

Sorry, didn't say in my case, I cannot use Session.
 
Here is a link that explores an important issue with validation functions: thread216-1194174
 
In fact, there is one more difficulty:

<form action="Next.asp" method="post" name="myform">
<input type="text" value="abc" name="input1">
<input type="submit">
</form>
'Can I pass the querystring and the form together:
<a href="javascript: document.myform.submit() ?n=1">Next1</a>
<a href="javascript: document.myform.submit() ?n=2">Next2</a>
<a href="javascript: document.myform.submit() ?n=3">Next3</a>
 
Or, anyway to pass the form and the number between <a> and </a>
<a href="javascript: document.myform.submit()>1</a>
<a href="javascript: document.myform.submit()>2</a>
<a href="javascript: document.myform.submit()>3</a>
 
how about creating a hidden field in the form that holds the value...

-DNG
 
DotNetGnat,

But I know the value=2 only after I click the tag
<a href="javascript: document.myform.submit()>2</a>
 
<form action="Next.asp" method="post" name="myform">
<input type="text" value="abc" name="input1">
<input type="submit">
</form>
<a ...>2</a>

After click tag <a ...>2</a>, I want to go to
Next.asp and pass the value "abc" from the input box and "2" from the tag.
 
I think DNG was suggesting something more like this:
[tt]
<form action="Next.asp" method="post" name="myform">
<input type="text" value="abc" name="input1">
<input type="hidden" name="secret">
<a href="javascript: document.myform.secret.value=2; document.myform.submit()>2</a>
</form>
[/tt]
 
Also this seems like more of a client-side JavaScript question than a server-side ASP question so you might find better answers from the JavaScript experts here: forum216
 
Yes....DotNetGnat's suggestion is a good one....I am going to write the code based on all your suggestions.
Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top