?
Solved

pass value from page to another pages form textbox

Posted on 2003-03-21
8
Medium Priority
?
209 Views
Last Modified: 2013-12-24
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
Comment
Question by:havik83rs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 1

Expert Comment

by:Wasistdas
ID: 8184184
select * from seminars

...

<input type="text" name="seminar" value="#seminar#">
0
 
LVL 15

Expert Comment

by:danrosenthal
ID: 8185078
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
 
LVL 14

Accepted Solution

by:
Renante Entera earned 300 total points
ID: 8185174
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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 14

Expert Comment

by:Renante Entera
ID: 8185193
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
 
LVL 6

Expert Comment

by:dash420
ID: 8185462
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
 
LVL 6

Expert Comment

by:dash420
ID: 8185471
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
 

Author Comment

by:havik83rs
ID: 8195519
Works perfectly, thanks!

Havik
0
 
LVL 14

Expert Comment

by:Renante Entera
ID: 8199584
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question