Link to home
Start Free TrialLog in
Avatar of havik83rs
havik83rs

asked on

pass value from page to another pages form textbox

Hi,

I have a page filled with seminars that the users can sign up for.  I also have links following each seminar that send the user to a register page with a form.  On this form there is a seminar text box that the user must fill out with the appropriate seminar name in order to be registered.

I would like to have this seminar text box filled out with the seminar name automatically.  Any ideas on how to do this?

Havik
Avatar of Wasistdas
Wasistdas

select * from seminars

...

<input type="text" name="seminar" value="#seminar#">
on the seminar page have links like this...

<A HREF="register.cfm?seminar_name=#seminar_name#">

and on the register page have a query and a text box like this...

<INPUT type="text" name="seminar" value="#seminar_name#">

ASKER CERTIFIED SOLUTION
Avatar of Renante Entera
Renante Entera
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Additional Reminders:

%20 is equivalent to a single space

And:

For you link [disp.cfm?seminar=Seminar One], the value for the seminar correspond to the name of the seminar that you want to be displayed for your seminar textbox.

OK...
Best Wishes!!!
i will rather suggests u to do it in hidden variable.

like this

seminar selection page.

<script language="javascript">
   function fndetail(myval){
     document.frmtest.method="psot"
     document.frmtest.hdnseminarname.value = myval
     document.frmtest.action="seminardtls.cfm"
     document.frmtest.submit()
   }
</script>

<cfquery name="qryseminar" datasource="dsn">
  select * from seminar
</cfquery>
<form name="frmtest">
<input type="hidden" name="hdnseminarname" value="">
<cfoutput query="qryseminar">
   <a href="seminardtls.cfm" onclick="fndetail('#semianr_details#');return false;">#semianr_details#</a>
</cfoutput>
</form>

seminardtls.cfm
<cfparam name="seminarname" default="">
<cfif isDefined("form.hdnseminarname")>
   <cfset seminarname= form.hdnseminarname>
</cfif>
<cfoutput>
Seminar Name :
<input type="text" name="txtseminarname" value="#seminarname#">
</cfoutput>


if u want to do it in url variable, don't forget to do urlencoding.

<a href="disp.cfm?seminar=URLEncodedFormat(seminar_name)">#seminar_name#</a></p>

refer it in details page for seminar name by url.seminar
Avatar of havik83rs

ASKER

Works perfectly, thanks!

Havik
Thanks for the points havik83rs.
I'm glad to help you solve your problem. I hope to help you again next time.