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

Passing a text input field parameter through URL

Status
Not open for further replies.

viv77

Programmer
Feb 22, 2001
6
SG
Hi,

Need some help here. I've a textinput field to be passed to another page through URL. However, the parameter never worked.

What i did is just a very simple one:
<cfform ....>
<input type=&quot;text&quot; name=&quot;var1&quot; value=&quot;#var1#&quot;>
<a href=&quot;form2.cfm?var=#var1#&quot;> Form2 </a>
</cfform>

However, the simple code doesn't work. I can't even display the variable (Object not found error)

And i noticed that at top the URL shown is:
form2.cfm?var=#var1
which is obviously incorrect.

Please enlightened me. THANKS A LOT!!


 
use cfoutput !!!!!!!
<cfoutput><a href=&quot;form2.cfm?var=#var1#&quot;> Form2 </a></cfoutput>

but why do you need to add the var1 to the url ??????? it's a form !!!!! as such, the variables are passed to the action page automatically !!!! what you're trying to do is realllly weird ... !

 
Thanks iza,

I've tried out but didn't work (the parameter not passed)
The URL shown:
form2.cfm?var=

The reason why i do this instead of submitting the form is i need to jump to another page for some processing before coming back to continue filling up the form. And i can't submit twice, can I?

Appreciate for further advice.
 
try
<cfoutput><a href=&quot;form2.cfm?var=#form.var1#&quot;> Form2 </a></cfoutput>
but i'm almost sure than inside the form, the form variables are NOT evaluated by coldfusion !!!!! as cf is server side and your form variable (till they are not submitted) reside client side ....
to do so you need javascript or any client side langage
and i'm almost sure you make thinks waaay too complicated (either you do the 1st form on the 1st page, then go to a second page to process AND display the rest of the form; or you fill both form on the same page and process them after submitting - if processing is needed before submitting, you still can)- but i'm not at your place


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top