Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

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
0
havik83rs
Asked:
havik83rs
1 Solution
 
WasistdasCommented:
select * from seminars

...

<input type="text" name="seminar" value="#seminar#">
0
 
danrosenthalCommented:
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#">

0
 
Renante EnteraSenior PHP DeveloperCommented:
Take this simple example:

Four your main page type this code:

<cfparam name="seminar" default="">
<input name="seminar" type="text" value="<cfoutput>#seminar#</cfoutput>">

Then save it as disp.cfm.

For your other file which displays the list of seminars.
Have this code:

<p><a href="disp.cfm?seminar=Seminar%20One">Seminar One</a></p>
<p><a href="disp.cfm?seminar=Seminar%20Two">Seminar Two</a></p>
<p><a href="disp.cfm?seminar=Seminar%20Three">Seminar Three</a></p>
<p><a href="disp.cfm?seminar=Seminar%20Four">Seminar Four</a></p>

Save as seminar.cfm.

Note: On the disp.cfm, it is required to have the <CFOUTPUT></CFOUTPUT> tags for the value of your textbox seminar.

Try to run this code...
I hope it will give you an idea for your problem.

GOODLUCK.
0
[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
Renante EnteraSenior PHP DeveloperCommented:
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!!!
0
 
dash420Commented:
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>


0
 
dash420Commented:
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
0
 
havik83rsAuthor Commented:
Works perfectly, thanks!

Havik
0
 
Renante EnteraSenior PHP DeveloperCommented:
Thanks for the points havik83rs.
I'm glad to help you solve your problem. I hope to help you again next time.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now