Lightwindow passing form variable to action page
Hi,
I have a form that is popup using lightwindow to allow users to fill out the form. For some reason, I couldn't get the form.variables to pass to the action page and insert into a database. Anyone has suggestions or ideas?
thanks.
link to open lightwindow pop up page. of course i've all the js required on the top of the page
<a href="form.cfm" params="lightwindow_width=500,lightwindow_height=600" class="lightwindow page-options">Form</a>
here is the form
<form id="form1" name="form1" method="post">
<p><label for="fname">First Name</label><input type="text" name="fname" id="fname" class="inputText" /></p>
<p><label for="lname">LastName</label><input type="text" name="lname" id="lname" class="inputText" /></p>
<p><p><a href="hello.cfm" params="lightwindow_form=form1" class="lightwindow_action" rel="submitForm"><button>Submit</button></a> or <a href="#" class="lightwindow_action" style="color: blue;" rel="deactivate">Cancel</a>
</p>
here is the action page for the form (hello.cfm)
<cfoutput>#form.fname# | #form.lname#</cfoutput>
I do not know if this is out it's supposed to do it or not but the form variables are not passing over to the action page.
thanks
Similar Messages
-
This test application has 3 frames.
I'm assigning a value "stuff" to a variable ("testfield1") in a javascript function ("getTest") that exists inside an html frame (testpage1.html)
Then, I click on the "test submit" hypertext link to pass the value of "testfield1" to the JSP frame (testpage2.jsp) by invoking a function ("getData") in "testpage2".
In function ("getData"), I am passing the variable "testfield1" as a parameter to the "getData" function in "testpage2".
In "testpage2" - in the ("getData" function) I try to assign the value of the variable "testfield1" to another variable called "testfld1".
Then, I try to extract the value of "testfld1" into a variable called "tstfld1" in a JSP scriptlet
....I.E. [ String tstfld1 = request.getParameter("testfld1"); ]
But, the value is apparently not passed successfully, as tstfield1 appears to be "null".
Can anyone explain what I'm doing incorrectly?
The code for this test app is below...
********testpage0 - the parent frame*********
<HTML>
<HEAD>
<TITLE>GlobalView Reports and Trending Menubar</TITLE>
</HEAD>
<FRAMESET FRAMEBORDER="0" ROWS="15%,85%">
<FRAME SRC="testpage0.html" NAME="testhtmlparent">
<FRAMESET FRAMEBORDER="0" COLS="23%,77%">
<FRAME SRC="testpage1.html" NAME="testhtml">
<FRAME SRC="testpage2.jsp" NAME="testjsp">
</FRAMESET>
</FRAMESET>
</HTML>
*******testpage1.html********
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<html>
<head><title>testpage1</title>
<link rel="stylesheet" type="text/css" href="./standard.css">
<script LANGUAGE="JavaScript">
parent.frames[2].location = "blank.html";
function getTest(reportType)
testfield1 = "stuff";
alert("testpage1.html...testfield1=" + testfield1 + ", reportType=" + reportType);
parent.frames[2].location = "testpage2.jsp";
parent.frames[2].getData(testfield1);
return;
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="reportRange">
<center>
<fieldset style="padding: 0.5em" name="customer_box">
<table cellpadding="0" cellspacing="0" border="0">
<tr class="drophead">
<td valign="top" height="0" ><span class="drophead">
test submit
</td>
</tr>
</table>
</fieldset>
</center>
</form>
</body>
</html>
*******testpage2.jsp*********
<%@ page language="java" import="java.io.*, java.util.*" errorPage="error.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<html>
<head>
<title>testpage2</title>
<script language="JavaScript">
function getData(testfield1)
alert("testpage2.jsp...testfield1=" + testfield1);
document.pageData.testfld1.value = testfield1;
document.pageData.submit();
</script>
</head>
<body>
<%
String error;
%>
<div id="HiddenForm">
<form name="pageData" method="post" action="testpage2.jsp" target="_self">
<input type="hidden" name="testfld1" value="0">
</form>
</div>
<%
String tstfld1 = request.getParameter("testfld1");
%>
<P> testfld1 = <%= tstfld1 %> </P>
</body>
</html>parent.frames[2].getData(testfield1); is in testpage1.html
so in the document.pageData.testfld1.value = testfield1; document = testpage1.html( not testpage2.html)
modifying the getData to accept the document object, and refering this object to parent.frames[2].document may help you.
good Luck .... -
Passing FORM variables through CFSET
I am writing an account creation page for my site. After the
user inputs the required information, I would like to 1. confirm
that their email is not a duplicate of another user 2. Pass them
off to another page that allows them to confirm the information
that they input and submit the info to the database. I would like
to have the email confirmed on that page through passing the
FORM.email variable to the #CGI.SCRIPT_NAME#. If the RecordCount on
the query for duplicate email addresses comes back VALUE=0, use
CFLOCATION to pass to the next page with the FORM variables intact.
However, as forms can only have one action attribute, what is the
best way to do this, in your opinion?
Thanks so much for your help!
danuse session var to store form data:
- user submits form.
- form posts to same page (to itself).
- check for duplicate email
- if no duplicate found, copy form to a sesion var and
cflocate to next
page; if duplicate found show error to user
- on next page display user-submitted data from the session
var
make sure session vars are enabled in cf administrator and
sessionmanagement is enabled in your appliction.cfm/cfc
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/ -
CAN I PASS FORM VARIABLES TO THE DATABASE PROCEDURE IN PERSONALIZATION
When I try to use form variable in the database procedure call from personalization I get the attached error.
Under forms personalization
From Actions tab --> builtin --> Execute Procedure when I call a database procedure and pass one of the form variable as parameter I get "ora-01008 couldn't be validate" error
Can we pass on form variables to the database package using personalization ? If yes, then is this the right way?
Message was edited by:
omitchelI tried customizing the Quoting Form, it works.
What you have done is correct, but this is how you call it
='begin
db_proc('''||${item.qothddet_main.quote_name.value}||''');
end'
here
qothddet_main : block name
quote_name : item name
Thanks
Tapash -
Passing form data from html page to JSP page
Hi,
I have a simple HTML page with a form on it that sends the information to a JSP page that stores the form data in a JSP session. I created a simple form that asks for the user's name, sends it to the JSP page, stores that in a session, then sends it to another JSP page which displays the name. This worked fine.
However, I added another input box to my form that asks for the user's age to do the same steps as outlined above. This does not work, and I'm not sure why. Here's the code from my HTML page:
<form method=post action="savename.jsp">
What's your name?
<input type=text name=username size=20 />
<p />
What's your age?
<input type=text name=age size=20 />
<p />
<input type=submit />Here's the code from my JSP page, savename.jsp (later on in the JSP page it links to another page, but that is not relevant):
<%
String name = request.getParameter("username");
String age = request.getParamater("age");
session.setAttribute("theName", name);
session.setAttribute("theAge", age);
%>Finally, here is the error message from Tomcat 6.0.9:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 3 in the jsp file: /savename.jsp
The method getParamater(String) is undefined for the type HttpServletRequest
1: <%
2: String name = request.getParameter("username");
3: String age = request.getParamater("age");
4: session.setAttribute("theName", name);
5: session.setAttribute("theAge", age);
6: %>
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)I do not understand the error, as it works fine when I simply try to retrieve "theName", but breaks when I try to retrieve both.
What is it I am missing here?
Thanks,
DanUmmm.... you misspelled "parameter" the second time
you tried to use it.......
That is incredibly embarrassing. Sorry if I made anyone think it was something more serious. Holy mackerel, I think it's time for me to read over my code much more carefully before posting about a problem.
Thanks for the help DrClap. -
Passing form variables in a single form
I am trying to make a form to select a starting and ending
month for a event search.
I have 2 list boxes populated with the months, but I want the
second box to begin from the first selection.
So if the user selects may in the first box, the second box
should list from may to december.
Is there any way to pass a form variable to another field
inside the same form?
I want to use a conditional <cfloop> to populate the
second box like <cfloop from= #variableA# to= 12>
then have the <options> inside the loop.
Thanks in advance for any help you can provide...this one has
me stumped!You can do it with javascript. Google related selects, there
are lot's of examples out there.
What happens if the user selects December in the 1st
box? -
[php+mysql] how to pass a variable to a page in a frameset
Hi all,
I have a problem with a php page sending a variable to a page
contained in
a frameset.
In the base page I have a link that sets a variable
(basepage.php&link=mylink) and loads a frameset.
How can I read this variable in a page contained in the
frameset?
What are the possible solutions?
I have to use frameset since the customer WANTS a music file
playing while
surfing the website. So, I created a frameset and loaded the
music on a
frame that will NOT change/reload during navigation. Is there
an
alternative that will allow me to load pages without
interrupting the base
music?
TIA
Tony ;)> I know David certainly doesn't encourage them in his
books - but why o
> why are these authors and publishes so content just to
rehash all the
> old out of date web techniques.
Because they are hacks.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Malcolm _" <[email protected]> wrote in message
news:[email protected]..
> On Thu, 17 Jul 2008 12:01:11 +0100, David Powers
<[email protected]>
> wrote:
>
>>Michael Fesser wrote:
>>> Of course using sessions on a frame site might
cause new problems and a
>>> slower download because of file locking.
>>
>>That's why frames are "evil". ;-)
>
>
> I was in Waterstones bookshop today - and as you do -
had a browse at
> the computer bookshelfs.
>
> An attractive book titled Website design - and published
in 2008.
>
> And guess what - still detailing frames and what they
can do for your
> website, and no mention of the downsides of using them.
> No wonder so many newbies are still confused.
>
> I know David certainly doesn't encourage them in his
books - but why o
> why are these authors and publishes so content just to
rehash all the
> old out of date web techniques.
>
> --
>
> ~Malcolm~*...
> ~* -
HI~
I have a cfform on my index.cfm page, and the action is set
to go to a confirm.cfm page. On that page, I want the user to be
able to look at the information they entered into the form, and
then hit "Submit" if it is correct. Right now, I am able to display
the form information on the confirm.cfm page, but I'm having a hard
time with my insert statement. Right now, when I hit the final
Submit button, an entry is made in the database, but none of the
variables are passed. I'm guessing this is because of the cfparam
default="" setting, but I don't know what else to set it as-- if I
try to set it as semester or form.semester, it says it is not
defined. Please help! Thanks!semi star gazer wrote:
> OK, I think I'm still missing something here. This is
what I have right now.
> With this code, I get a blank entry in the database when
the user hits the
> Submit button.
>
> <cfparam name="form.semester" default="">
>
> <cfif isDefined("form.submitEval")>
>
> <!--- insert form data into database --->
> <cfquery name="insertEval" datasource="intern">
> INSERT INTO mentorEvals (
> semester
> ) VALUES (
> '#Trim(form.semester)#'
> )
> </cfquery>
>
> <cfform action="#CGI.SCRIPT_NAME#" name="submitEval"
METHOD="post">
> <cfinput type="hidden" name="semester"
value="form.semester">
> <!--- Submit Button that reads "Submit Evaluation"
--->
> <cfinput type="submit" value="Submit Evaluation"
name="submitEval"
> id="submitEval">
> </cfform>
>
try using <input type="hidden" ...> instead of
<cfinput ...> - i seem to
recall there being issues with hidden cfinput fields...
also - where's your closing </cfif>??? it should be
after </cfquery> - i
hope it is actually there...
just to make sure semester is passed from first form, you can
put
<cfoutput>#form.semester#</cfoutput> right after
your <cfparam>
NOTE: you do not really need that <cfparam> there... it
does not do
anything... unless you are planning to use it later for
validation
routines... i wonder if it may be tampering with the semester
value...
it shouldn't, but who knows...
Azadi Saryev
Sabai-dee.com
Vientiane, Laos
http://www.sabai-dee.com -
Instead of using session How to pass the variable from action class to JSP
Im using Struts1.2 version.Created the Sample application to get the username.Upto action class im getting the username then i have to display the username in the JSP.Is there any options rather than using session variable to display the username.
did you check the answer in your previous thread
Passing Variable from Javascript to Controller -
How do you pass a variable from one page to another thru a button
I have a page that has a button that goes to another page and allows the user to create a new record related to the data on the previous page.
The first page is a master, while the second page is a detail. I need the primary key from the first page to update a column in the detail page.
How do I get the primary key in the second page and how do in put the data in the correct column?Hi Nielsen,
The master detail form should handle everything for you already...Select all rows in each table but only display the records besides the primary keys. Try creating a new master-detail form with this idea, don't bother trying to change some other page.
Mike -
Pass form data to redirect page?
This site
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_15239
explains how to do this for VBScript (ASP), but with 8.02 DW
no longer generates the same code for Record Insert pages. The
instructions instruct the user to look for this line of code
If (CStr(Request("MM_insert")) <> "") Then
and then insert the desired session variable info below.
However, this line no longer exists, so where do I insert the
session variable into to get this work. As of now, this is broken.
Any ideas?Bit of a convoluted method that. The easiest solution would
be to use
Server.Transfer instead of Response.Redirect. The state of
the page is then
maintained.
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004 -
Using HTML, what happens to form variables on submit?
If I create a simple AIR app that has two files, lets say index.html and next.html, how would I pass form variables from one page to the next since there is no server side scripting?
Can it be done via javascript somehow, by maybe saving the variables from the first page and then retreiving them on the second?
Here a sample of what I am trying to accomplish:
index.html
<html>
<body>
<form method="GET" action="next.html" name="theName">
Name:
<input type="text" name="textField">
<input type="submit" value="submit" name="submitButton">
</form>
</body>
</html>
next.html
<html>
<body>
<!-- How to display textField variable from previous pages theForm field? -->
</body>
</html>Found solution here:
http://forums.adobe.com/message/2649503#2649503 -
Hi
i am trying to pass form variables from one page to another
can anyone forward me to any to useful web sites (tutorials)?
thanksyou can use a query string to append illegal variables.
-
CF Set form.variable for query and Next/Previous pages error
I have a CF form with a select that posts to a CF "action" page.
On the action page I: CFSET ItemNumber=#form.ItemNumber#
I CFOUTPUT the 'ItemNumber' into the CFQUERY (which is an Inner Join dependant on the '#ItemNumber#')...
All of the above works just fine and displays the database fields in color alternating rows, per the rest of the code.
Here's the problem:
I'm displaying 40 rows on a page per "Next and Previous" code. (CFPARAM name="start" default="1" and CFPARAM name="disp" default="40" along with the rest of the NextN code in the header and body). This does display 40 rows on the page and puts a link at the bottom of the page "Next 40 Rows", etc.
Note: I'm only querying the database once and using the query (query name="data") to populate the table rows And the NextN code (CFOUTPUT name="data") And (CFIF start + disp GREATER THAN data.RecordCount, etc)...
The problem happens when you click the "Next 40 Rows" link to display the 2nd page of rows. Since (I'm assuming) this NextN code is 're-reading' the same page from top to bottom, an error is thrown when the code tries to read the CFSET ItemNumber=#form.ItemNumber# at the top of the page.
With the #form.ItemNumber# on this action page Originally coming from the previous posting of the form to this action page, when the "Next 40 Rows" link is clicked and the NextN code re-reads this action page - the CFSET ItemNumber (#form.ItemNumber) is not getting populated and throws the error...
I hope I've not made this sound confusing.
I can get the NextN code to work when I'm just querying the database without "flying in" a form variable. But when I CFSET a variable (#form.ItemNumber#) that is inserted into the query, the second page of the NextN throws an error and doesn't display.
I would include the page code here but it would be fairly lengthy and, as well, the NextN code is a 'standard' CF code -- I've narrowed the problem down to the above "Element is undefined" (when the page tries to reload from the "Next 40 Rows" link) and am hoping there's a simple fix or another way to display the records in Next and Previous pages.
Thanks to anyone in advance for shedding light on this.
- eThank you for the reply, Owain.
Yes - The Next/Previous at the bottom of the page are hyperlinks.
<a href="ThisPage.cfm?start=#Evaluate("start + disp")#">
The following is at the top of the page (and is the variable from the form that I CFOUTPUT in the query):
<cfparam name="ItemNumberDropdown01" default="">
<cfset ItemNumber = #form.ItemNumberDropdown01#>
The error report showed that the "Next Page" hyperlink was reading an undefined variable... although when the "action page" first opens from the form posting to it, it populates the CFSET just fine (per the cfparam and cfset above)... As you mention, the hyperlink clearing the form scope is what causes the error in trying to display the next set of records...
The form page and the 'action page' are both secure pages with an application page setting the session, etc. Am I at risk in using an URL scope?
Where would this URL scope be put? (The href is shown above - would the URL scope go in this? - How would this be written?)
The CFPARAM and CFSET would still exist at the top of the 'action page' and still throw an error wouldn't it or would this be replaced with something else to read the form.variable for this 'first' action page to be displayed?
Thanks again for the 'education' on this...
- ed -
Hello -
Thanks for Spry!
I'm running into a problem that probably exists because I've
cribbed a bunch of code from your demos that I don't fully
understand. I have a set of photo galleries, which I've set up like
the demo. A test link is here:
http://www.clubmax3d.com/photos_test.cfm
and it works wonderfully. When you choose a new gallery from
the drop down, everything loads up as it should.
However, I want to be able to call this page with a specific
gallery chosen - i.e. with a certain row preselected from the
dsGalleries. I actually do have this working, but after the page
appears with my chosen gallery selected, the drop down menu no
longer works to select the other galleries. Test this by going to:
http://www.clubmax3d.com/photos_test.cfm?g=2
I think the page breaks because I've set up an onDataChanged
observer for my dsGalleries so that I can change the preselected
row on page load (or really, when the data first loads). But then
this onDataChanged observer sticks around, and interferes with the
onchange function called by the select drop-down menu.
Can I remove the onDataChanged observer after the first call
to it is made?
Or a way to reconcile my observer with the "onchange"
function?
Or is there a better way to pass my variable to the page?
Right now it uses coldfusion like this:
<cfoutput>
<script>
var galID = #URL.g#;
</script>
</cfoutput>
<script type="text/javascript">
if (galID){
dsGalleries.addDataChangedObserver("myObserver", {
onDataChanged: function(ds, type) {
dsGalleries.setCurrentRowNumber(galID)} })
</script>
Thanks very much in advance for any advice (and please
forgive the newbie code)
p.s. if you have anaglyph 3D glasses put them on for some fun
:)Hi ImagicDigital,
You can actually display a "Loading" message/markup today if
you know how to do some programming.
You just have to register an observer on either the region or
the data set, depending on what you want to trigger the status
message.
The state notification mechanism that Don Booth has been
mentioning in some of his posts/replies has to do with a feature we
are implementing that will allow folks to mark pieces of
spry:regions as markup to use automatically for a given state, so
folks don't have to program anything.
--== Kin ==--
Maybe you are looking for
-
How can I scroll down with Mavericks OSX10.9.4? The right-hand scroll bar is missing.
-
Printer installs, but doesn't show in programs
This has really caused me some stress. I used this printer when I first got it and my computer for school. It worked great. Then I was out for summer and went back to school and it never would show up as a printer again. I have removed the device and
-
Purchase Order: Printer or external Send
Hallo, we want to change our Output in Purchase Order from Print Output to Fax or external Send. I have the Problem, that the default Medium of Outputtype "NEU" is always Print output(1). How can i manipulate it, that the default is Fax(2) or externa
-
How does the fault system work with AppleCare warranty extension?
I'm an owner of an iPhone 4S on Telus Mobility in Canada and I have two year AppleCare warranty extension that is linked to my phone. I've had my iPhone for over a year now with no issues, so this question is meant for reference if and when I do need
-
Shared services taking longer after moving from LDAP to MSAD
we used to use LDAP for external authentication and the security refreh in EAS used to take like 1-2 mins. We recently moved to MSAD and now the refresh is taking more than 20mins. Even its taking a while to diplsy users to give them planning or essb