Question

pass coldfusion form values to a new popup window

Asked by: veeroy

I have two coldfusion forms the first has a select box that is populated for a data base. I also has text areas that are populated when an item in the selectbox is selected. Last on the first form are checkboxes. The second form is opened into a new window with a button (not a submit button) a button onClick.  How do I pass the values of all the different types of input to the new window. Please show code to help me see how it is done I am new to coldfusion and javascript.

thanks

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-07-22 at 11:57:43ID21068167
Tags

coldfusion

,

window

,

popup

,

form

,

pass

Topics

ColdFusion Application Server

,

ColdFusion Studio

Participating Experts
5
Points
500
Comments
16

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. detect which selectbox
    anyone can tell me how to detect 2 different selectbox using javascript???
  2. selectbox and checkboxes
    hi everyone... i have a form in which i have a group of checkboxes and a selectbox i have a js which populates the selectbox with the value of the checkbox when it is checked and when it is unchecked the js removes the option from the selectbox. but i have another function ...
  3. chain selectboxes
    im not too sure how to approach this but what im trying to do is the following: I have a access database table containing a location field and a title field and are both memo datatypes. the location field contains locations - Aberdeen, Edinburgh, Glasgow, Stirling, Dundee, ...
  4. chain selectboxes again
    any chance of getting this to work? our senerio: ive got 3 fields in a table called location, title and jobtype i want to have 3 select boxes and have them dynamically populate based on the selectbox selections. example 1: if i select location = Aberdeen, then the titles...
  5. Javascript popup that populates two form textarea's
    Ok I have a popup window that populates one form field by clicking a link and right now it returns only one of the values Either <%=ors("id")%> or <%=ors("teamid")%>. but I do not know javascript so I was hoping that someone could help me figur...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: JackfyPosted on 2004-07-22 at 13:38:34ID: 11616529

I'm not quite understand your question.

> The second form is opened into a new window with a button (not a submit button) a button onClick

Where is the button, on the first form?
Is that when you click on the button on the first form, then pass the first forms values into the 2nd form?

 

by: JackfyPosted on 2004-07-22 at 13:44:31ID: 11616577

1st Form:

<form name="FirstForm" action="SecondForm.cfm" method="post" target="new">
         <select name="var1">
              <option value="1">1</option>
              <option value="2">2</option>
              <option value="3">3</option>
              <option value="4">4</option>
         </select>
         <textarea name="var2" cols="10" rows="10"></textarea>
         <input type="checkbox" name="var3" value="test">
         <input type="button" value="submit" onclick="document.FirstForm.submit()">
</form>

SecondForm.cfm

<cfoutput>
var1 = #var1#<br>
var2 = #var2#<br>
var3 = #var3#
</cfoutput>

Note: in some browser, if your checkbox is unchecked, your 2nd page will not get the variable passed. so you should have a <cfparam name="var3" default=""> in place.

 

by: veeroyPosted on 2004-07-22 at 14:06:00ID: 11616799

Yes, on the first form I have a email feed back button which opens a new window so that the user can fill out the feedback textarea and send it with a button on the second form.  I also have a submit button on the first form that after they send their feedback if they choose they can click the submit button and it will update the database tables with all the values that were filled out on the first form.  So I need to pass some of the values to the new window as well as be able to submit all the values on the first form to a database.

 

by: veeroyPosted on 2004-07-22 at 14:23:35ID: 11616964

Here is what my <cfform> looks like for the first form
-----------------------------------------------------------------
function display()
{      
      feedbackWin      = window.open('http://lpowebd1.novusservices.com/cma/call_escalation_tracker/call_escalation_ticksheets/escalation_feedback.cfm','feedbackWin',' width=700, height=500')
      //feedbackWin.document.escalation_feedback.employee_racf.value             =       opener.document.call_tracker_form.employee_racf.value;
    //feedbackWin.document.escalation_feedback.email_addr.value                   =       opener.document.call_tracker_form.employee_racf.value;
      //feedbackWin.document.escalation_feedback.account_number.value             =       opener.document.call_tracker_form.account_number.value;
      //feedbackWin.document.escalation_feedback.escalation_agent.value            =       opener.document.call_tracker_form.escalation_agent.value;
   
    //feedbackWin.document.close();
}

</script>



<!--- <cfif isDefined(#FORM.tl_racf) and #FORM.tl_racf != "">
      <cfoutput>Recording #FORM.tl_racf#</cfoutput>
</cfif> --->
<cfif isDefined("#COOKIE.racfid#")>
      <cfset SESSION.racfid = COOKIE.racfid>
</cfif>

<!---<cfset SESSION.dmracfid = cma_hierarchy.employee_racf[#SESSION.racfid#]>
<cfoutput>SESSION>dmracfid</cfoutput>--->
<cfform name="call_tracker_form" method="post" action="output.cfm" target="blank">

<table width="499" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="499">
        <table width="100%" border="0" cellspacing="5" cellpadding="0" align="center">
              <tr valign="top">
                  <td colspan="2"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><div align="center"><strong>Call
                        Escalation Tracker</strong></div></font></td>
          <tr valign="top">
                  <td width="95%"><table width="94%" border="0" align="left">
                    <tr>
                      <td width="50%" nowrap><div align="center"><font color="#333333"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Cad/Escalation
                                Agent:<cfinput type="text" name="escalation_agent" value="#SESSION.racfid#" maxlength="12" size="12"></cfinput></font></strong></font></div>
                      </td>
                    </tr>
                  </table></td>
                </tr>
               <tr valign="top">
                  <td height="200" valign="left" nowrap> <div align="right"><font color="#333333"><strong></strong></font></div>                    
                          <font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp; </font>
                    <table width="100%" height="177" border="0" align="left">
                      <tr>
                        <td width="31%" nowrap>
                                    <p align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Account Number:
                                    <input type="text" name="account_number" value="" size="19"></strong></font></p>
                                    <p align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Account Manager: <font size="1" face="Verdana, Arial, Helvetica, sans-serif">
                                    <select name="employee_list"  onChange="setAgent_TL_DM_value()">
                                                <option>Select RACF </option>
                                          <cfoutput query="cma_hierarchy">
                                                <option value="#employee_racf#">#employee_racf#
                                           </cfoutput>
                                  </select></strong></font></p>
                                    <p align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Team Leader:
                                    <input type="text" name="tl_racf" value="" size="12"></strong></font></p>
                                    <p align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Department Manager:
                                    <input type="text" name="dm_racf" value="" size="12"></strong></font></p>
                        </td>
                                    <td width="69%" nowrap>
                                    <table align="left">
                                          <cfoutput query="createcheckboxes">  
                                                <tr>    
                                                      <td><input type="checkbox" name="result_type" value="#result_type#" onClick="selected_count()">#result_type#</td>
                                                </tr>  
                                          </cfoutput>  
                                    </table>
                                    </td>
                                </tr>
                    </table>
                 </td>
          </tr>
                        <tr valign="top">
                  <td height="53" valign="middle" nowrap>
                          <table width="98%" border="0" align="center">
                                <tr>
                      <td width= "50%" nowrap><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
                          <input type="button" value="Add Feed Back" onClick="display()">
                        </font></div>
                      </td>
                      </tr>
                 </table>                          
                <tr valign="top">
                  <td height="41" valign="middle" nowrap>
                          <table width="98%" border="0" align="center">
                                <tr>
                      <td width= "50%" height="40" nowrap><div align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
                          <input type="submit" value="Call Complete" onClick="submit()">
                        </font></div>
                      </td>
                      <td width="50%" nowrap><div align="left"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
                          <input name="Reset" type="Reset" value="Reset Fields">
                        </font></div>
                      </td>
                    </tr>
                 </table>
                  </td>
          </tr>
      </table>
    </td>
  </tr>
</table>
</cfform>

------------------------------------------------------------

Here is my second <cfform>

-------------------------------------------------------------
<cfform name="escalation_feedback" method="post" action="output.cfm">
    <table align="center" border="0" width="600">
        <td height="23">
             <tr>
            <td><table border="0" width="525">
                <tr>
                    <td align="right">Agent RACF:</td>
                    <td><cfinput type="text" size="50" name="employee_racf" value=""></cfinput></td>
                </tr>
                <tr>
                    <td align="right">Agent Email:</td>
                    <td><cfinput type="text" size="50" name="email_addr" value=""></cfinput></td>
                </tr>
                        <tr>
                    <td align="right">Account Number:</td>
                    <td><cfinput type="text" size="50" name="account_number" value=""></cfinput></td>
                </tr>
                <tr>
                    <td align="right">Cad/Escalation Agent:</td>
                    <td><cfinput type="text" size="50" name="escalation_agent" value="#SESSION.racfid#"></cfinput></td>
                </td>
                </tr>
            </table>
            <td height="27"></td>
        <td height="28"></tr>
        <tr>
            <td>
                  <table border="0" width="500">
                <tr>
                    <td valign="top" colspan="2">Escalation Feed Back:</td>
                </tr>
                <tr>
                    <td colspan="2"><textarea name="feed_back" rows="8" cols="60"></textarea></td>
                </tr>
                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td><input type="submit" name="submit" value="Submit Feed Back" onClick="submit()"></td>
                    <td align="right"><input type="reset" name="reset" value="Reset fields"></td>
                </tr>
            </table>
            </td>
        </tr>
    </table>
    <p>&nbsp;</p>
</cfform>

 

by: hartPosted on 2004-07-23 at 03:32:25ID: 11620213

check this out

<!--- First form --->

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function feedBack()
{
      feedbackWin  = window.open('blank.htm','feedback','width=700, height=500');
      document.call_tracker_form.action = "http://lpowebd1.novusservices.com/cma/call_escalation_tracker/call_escalation_ticksheets/escalation_feedback.cfm";
      document.call_tracker_form.target = "feedbackWin"
      document.call_tracker_form.submit();
}

function submitForm()
{
      document.call_tracker_form.action = "output.cfm";
      document.call_tracker_form.target = "";
      document.call_tracker_form.submit();
}
//-->
</SCRIPT>

<!---<CFIF isDefined(#FORM.tl_racf) and #FORM.tl_racf != ""><CFOUTPUT>Recording #FORM.tl_racf#</CFOUTPUT></CFIF>---><CFIF isDefined("#COOKIE.racfid#")><CFSET SESSION.racfid = COOKIE.racfid></CFIF><!---<CFSET SESSION.dmracfid = cma_hierarchy.employee_racf[#SESSION.racfid#]><CFOUTPUT>SESSION>dmracfid</CFOUTPUT>--->
<FORM name="call_tracker_form" action="output.cfm" method="post">
      <TABLE width="499" border="0" cellpadding="0" cellspacing="0">
            <TR>
                  <TD width="499">
                        <TABLE width="100%" border="0" cellspacing="5" cellpadding="0" align="center">
                              <TR valign="top">
                                    <TD colspan="2"><FONT color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><DIV align="center"><STRONG>Call Escalation Tracker</STRONG></DIV></FONT>
                                    </TD>
                                    <TR valign="top">
                                          <TD width="95%">
                                                <TABLE width="94%" border="0" align="left">
                                                      <TR>
                                                            <TD width="50%" nowrap><DIV align="center"><FONT color="#333333"><STRONG><FONT size="2" face="Verdana, Arial, Helvetica, sans-serif">Cad/Escalation Agent: <INPUT TYPE="Text" NAME="escalation_agent" VALUE="#SESSION.racfid#" MAXLENGTH="12" SIZE="12"></FONT></STRONG></FONT></DIV></TD>
                                                      </TR>
                                                </TABLE>
                                          </TD>
                                    </TR>
                                    <TR valign="top">
                                          <TD height="200" valign="left" nowrap><DIV align="right"><FONT color="#333333"><STRONG></STRONG></FONT></DIV><FONT size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp; </FONT>
                                                <TABLE width="100%" height="177" border="0" align="left">
                                                      <TR>
                                                            <TD width="31%" nowrap>
                                                                  <P align="right"><FONT size="1" face="Verdana, Arial, Helvetica, sans-serif"><STRONG>Account Number:      <INPUT type="text" name="account_number" value="" size="19"></STRONG></FONT></P>
                                                                  <P align="right"><FONT size="1" face="Verdana, Arial, Helvetica, sans-serif"><STRONG>Account Manager: <FONT size="1" face="Verdana, Arial, Helvetica, sans-serif">
                                                                  <SELECT name="employee_list" onChange="setAgent_TL_DM_value()">
                                                                        <OPTION>Select RACF</OPTION>
                                                                        <CFOUTPUT query="cma_hierarchy">
                                                                              <OPTION value="#employee_racf#">#employee_racf#</OPTION>
                                                                        </CFOUTPUT>
                                                                  </SELECT></STRONG></FONT></P>
                                                                  <P align="right"><FONT size="1" face="Verdana, Arial, Helvetica, sans-serif"><STRONG>Team Leader: <INPUT type="text" name="tl_racf" value="" size="12"></STRONG></FONT></P>
                                                                  <P align="right"><FONT size="1" face="Verdana, Arial, Helvetica, sans-serif"><STRONG>Department Manager: <INPUT type="text" name="dm_racf" value="" size="12"></STRONG></FONT></P>
                                                            </TD>
                                                            <TD width="69%" nowrap>
                                                                  <TABLE align="left">
                                                                  <CFOUTPUT query="createcheckboxes">
                                                                        <TR>
                                                                              <TD>                                                                                          
                                                                                    <INPUT type="checkbox" name="result_type" value="#result_type#" onClick="selected_count()">&nbsp;#result_type#
                                                                              </TD>
                                                                        </TR>
                                                                  </CFOUTPUT>
                                                                  </TABLE>
                                                            </TD>
                                                      </TR>
                                                </TABLE>
                                          </TD>
                                    </TR>
                                    <TR valign="top">
                                          <TD height="53" valign="middle" nowrap>
                                                <TABLE width="98%" border="0" align="center">
                                                      <TR>
                                                            <TD width="50%" nowrap><DIV align="center"><FONT size="1" face="Verdana, Arial, Helvetica, sans-serif"><INPUT type="button" value="Add Feed Back" onClick="feedBack()"></FONT></DIV></TD>
                                                      </TR>
                                                </TABLE>
                                          </TD>
                                    </TR>
                                    <TR valign="top">
                                          <TD height="41" valign="middle" nowrap>
                                                <TABLE width="98%" border="0" align="center">
                                                      <TR>
                                                            <TD width="50%" height="40" nowrap><DIV align="right"><FONT size="1" face="Verdana, Arial, Helvetica, sans-serif"><INPUT type="button" value="Call Complete" onClick="submitForm()"></FONT></DIV></TD>
                                                            <TD width="50%" nowrap><DIV align="left"><FONT size="1" face="Verdana, Arial, Helvetica, sans-serif"><INPUT name="Reset" type="Reset" value="Reset Fields"></FONT></DIV></TD>
                                                      </TR>
                                                </TABLE>
                                          </TD>
                                    </TR>
                        </TABLE>
                  </TD>
            </TR>
      </TABLE>
</FORM>
      
<!--- 2nd form page [pop up window ] --->
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function AssignValues()
{
      window.opener.document.call_tracker_form.employee_racf.value = document.escalation_feedback.employee_racf.value;
      window.pener.document.call_tracker_form.account_number.value = document.escalation_feedback.account_number.value;
      window.opener.document.call_tracker_form.escalation_agent.value = document.escalation_feedback.escalation_agent.value;
      window.close();
      return false;
}
//-->
</SCRIPT>

<FORM name="escalation_feedback" method="post" action="output.cfm" ONSUBMIT="return AssignValues()">
      <TABLE align="center" border="0" width="600">            
            <TR>
                  <TD>
                        <TABLE border="0" width="525">
                              <TR>
                                    <TD align="right"> Agent RACF: </TD>
                                    <TD><INPUT type="text" size="50" name="employee_racf" value=""></TD>
                              </TR>
                              <TR>
                                    <TD align="right"> Agent Email: </TD>
                                    <TD><INPUT type="text" size="50" name="email_addr" value=""></TD>
                              </TR>
                              <TR>
                                    <TD align="right"> Account Number: </TD>
                                    <TD><INPUT type="text" size="50" name="account_number" value=""></TD>
                              </TR>
                              <TR>
                                    <TD align="right"> Cad/Escalation Agent: </TD>
                                    <TD><CFOUTPUT><INPUT type="text" size="50" name="escalation_agent" value="#SESSION.racfid#"></CFOUTPUT></TD>
                              </TR>
                        </TABLE>
                  </TD>
            </TR>
      </TABLE>      
      <TABLE border="0" width="500">
            <TR>
                  <TD valign="top" colspan="2"> Escalation Feed Back: </TD>
            </TR>
            <TR>
                  <TD colspan="2"><TEXTAREA name="feed_back" rows="8" cols="60"></TEXTAREA></TD>
            </TR>
            <TR>
                  <TD colspan="2">&nbsp;</TD>
            </TR>
            <TR>
                  <TD><INPUT type="submit" name="submitbtn" value="Submit Feed Back"></TD>
                  <TD align="right"><INPUT type="reset" name="reset" value="Reset fields"></TD>
            </TR>
      </TABLE>      
</FORM>

Regards
Hart

 

by: mrichmonPosted on 2004-07-23 at 08:48:29ID: 11622615

You can also look at passing the results via URL to the second form since you are not using submit.

Then have the values from the 1st form written into hidden fields in the second form so that when the second form submits you get all of the values...

 

by: veeroyPosted on 2004-07-23 at 09:12:26ID: 11622846

I understand that I can also use the URL but how do I display the values in the new popup window so that the user can see what values were passed to that window.  I just don't understand how, I am a newbe to coldfusion and I am learning  coldfusion along with Javascript.

 

by: mrichmonPosted on 2004-07-23 at 09:51:50ID: 11623232

you can print them to the screen, you can display them in inputs - it is really up to you

 

by: veeroyPosted on 2004-07-23 at 10:25:12ID: 11623569

OK, but could anyone show me (with code) how to pass it on the URL and explain how it works so that I can understand how it is done and not feel lost.

 

by: hartPosted on 2004-07-23 at 10:32:20ID: 11623644

hey buddy i already gave u the solution...

i am submitting the first form to the popupwindow form...

so what ever values are there in the parent form will be accessed in the popup form...

thats is

just try this in the pop up window...

<cfoutput>#form.account_number#</cfoutput>

in the pop up window this will show the value from the first form...
thats all...


now assign this value to the input type text

<TR>
                              <TD align="right"> Agent RACF: </TD>
                              <TD><INPUT type="text" size="50" name="employee_racf" value="<cfoutput>#form.employee_racf#</cfoutput>"></TD>
                         </TR>
                         <TR>
                              <TD align="right"> Agent Email: </TD>
                              <TD><INPUT type="text" size="50" name="email_addr" value=""></TD>
                         </TR>
                         <TR>
                              <TD align="right"> Account Number: </TD>
                              <TD><INPUT type="text" size="50" name="account_number" value="<cfoutput>#form.account_number#</cfoutput>"></TD>
                         </TR>
                         <TR>
                              <TD align="right"> Cad/Escalation Agent: </TD>
                              <TD><CFOUTPUT><INPUT type="text" size="50" name="escalation_agent" value="#SESSION.racfid#"></CFOUTPUT></TD>
                         </TR>

Regards
Hart

 

by: veeroyPosted on 2004-07-23 at 10:48:14ID: 11623785

Hart, Your solution submits the form and I don't want to submit the form at this time I just want to pass the form values to the popup window have the user feel out the feed back and submit that close the popup window then on the first form submit the values to a database.  besides I like your solution, but you don't need to be rude about it.  I'm just trying to understand all of this coldfusion and exploring all the options to see what will work best so far yours is what i am working with to acomplish what I am trying to do.  I am a newbe not an expert!

 

by: mrichmonPosted on 2004-07-23 at 11:00:54ID: 11623892

You would have a link that opens the second window using an onclick like this :

onclick="window.open(secondpage.cfm?var1=value&var2=value&var3=value);"

Then in the seond page you could do

#URL.var1# to display it to the screen and also
<input type="hidden" name="var1" value="#URL.var1#"> to have it as a hidden input at the same time.

Then when the second page form is submitted those values will be submitted as well.

 

by: substandPosted on 2004-07-24 at 16:38:03ID: 11630159

say your first form is like:

<form name="firstform" id="firstform" action="blah" method="post">
<input type="text" name="inputone" value="whatever">

<input type=button onclick="window.open(...);">
</form>

then in the 2nd page you can do:
<script>

this.formtwo.inputone.value=window.opener.firstform.inputone.value;

</script>


----------------------

i think he's looking for a solution like that (passing the variables via javascript and not thru submitting the form, since he specifically said he didnt want to submit it)... i dont have the time to actually check the syntax, so if one of you other experts wants to chime in on this, please do.

 

by: jyokumPosted on 2004-07-25 at 08:44:55ID: 11632248

expanding on what substand said...

On your main page you would have code similar to

<script>
function popup(){
      var winProps = "height=300,width=300";
      window.open('popup.cfm', 'child', winProps);
}
</script>
<form name="formNameHere" action="whatever.cfm" method="post">
field1 <input type="text" name="field1"><br />
field2 <input type="text" name="field2"><br />
field3 <input type="text" name="field3"><br />
<form>
<a href="javascript:popup();">click me</a>


Then, your popup window would look something like

<form name="frmPopup" action="whatever.cfm" method="post">
field 1 <input type="text" name="field1"><br />
field 2 <input type="text" name="field2"><br />
field 3 <input type="text" name="field3"><br />
</form>
<script>
frmPopup.field1.value = window.opener.formNameHere.field1.value;
frmPopup.field2.value = window.opener.formNameHere.field2.value;
frmPopup.field3.value = window.opener.formNameHere.field3.value;
</script>

 

by: JackfyPosted on 2004-07-26 at 08:22:39ID: 11638261

veeroy, I'm still confused what exactly you want. Here is the code based on my assumption. (Do you want to pass the data back from the 2nd form to 1st form as well?)

1st Form:
<script language="JavaScript">
function mySubmit() {
      document.FirstForm.target = "_self"
      document.FirstForm.action = "Write2DB.cfm"
      document.FirstForm.submit()
}

function myFeedback() {
      document.FirstForm.target = "feedback"
      document.FirstForm.action = "EmailFeedback.cfm"
      document.FirstForm.submit()
}
</script>


<form name="FirstForm" method="post">
         <select name="var1">
              <option value="1">1</option>
              <option value="2">2</option>
              <option value="3">3</option>
              <option value="4">4</option>
         </select>
         <textarea name="var2" cols="10" rows="10"></textarea>
         <input type="checkbox" name="var3" value="test">
         <input type="button" value="Email Feedback" onclick="myFeedback()">
         <input type="button" value="submit" onclick="mySubmit()">
</form>

SecondForm.cfm

<cfoutput>
var1 = #var1#<br>
var2 = #var2#<br>
var3 = #var3#
</cfoutput>

 

by: veeroyPosted on 2004-07-26 at 16:30:50ID: 11642452

Thanks Jackfy and Jyokum what you posted pointed me in the correct direction and the solution to my problem. Thanks again you both were a big help in making me understand coldfusion.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...