Using Input Type Button to link to Frame Login. NeedHelp!!

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Using Input Type Button to link to Frame Login. NeedHelp!!

    Here is the working code and what I have that doesn't work.

    Please Help!

    Working:
    <td width="120" nowrap>&nbsp;&nbsp;<a href="EMP_Data.cfm?EMPID=#ID#"
    target="rightFrame"><b>#lname#</b></a></td>

    To:
    <cfform action="EMP_Data.cfm?login=Yes&EMPID=#ID#" name="Add_Emp">
    <table width="240" bordercolor="000000" bordercolorlight="000000"
    bordercolordark="000000" border="1" cellpadding="0" cellspacing="0">
    <tr>
    <th>Login ID</th><td><cfinput type="password" name="Login_ID_Input"
    required="yes" message="You must supply a login ID"></td>
    </tr>
    <tr>
    <th>Password</th><td><cfinput type="password" name="Password_Input"
    required="yes" message="You must supply a password"></td>
    </tr>
    <tr>
    <td colspan="2" align="center"><input type="submit" name="submit"
    value="enter"></td>
    </tr>
    </table>
    </cfform>

    Not working input type button code:
    <input type = "button" value = "Login as Administrator" onclick =
    "EMP_Data.cfm?EMPID=#ID#" target="rightFrame">

    Captain Ru Guest

  2. Similar Questions and Discussions

    1. input type="button"
      Hi all, I have a flash form that contains an input type="button" with an onclick event that goes to an AS code. I need to be able to access the...
    2. $_POST behavior from input=submit vs input-type=button
      Hello all, I have been trying to solve an annoying behavior with PHP (I think). Maybe some of you have encountered the same and have some ideas....
    3. Link a Button to a frame
      I am trying to link a button to a frame but when I test the movie it keeps on flashing and it has a error. Can you give me step by step on how to do...
    4. Save my (ass)ets! Trying to Link a button to a frame in another scene
      I'm using Flash 4 and I can't get my button to link to the main scene in my flash program. I created a movie button within a movie button and I'm...
    5. <button> instead of <input type=button>
      Is there an option in dreamweaver MX to set this? I want to use the <button> tag instead of the <input> tag for my buttons because of the extra...
  3. #2

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    What happens if you do...

    <cfform action="EMP_Data.cfm?login=Yes&EMPID=#ID#" name="Add_Emp"
    target="rightFrame">

    or

    <cfform action="EMP_Data.cfm?login=Yes&EMPID=#ID#" name="Add_Emp"
    target="_top.rightFrame">




    BSterner Guest

  4. #3

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    currently the <input type< is not held in a form. Would I first have to place it within form tags?
    Captain Ru Guest

  5. #4

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    Basically I want the 'Not working input type code' to refer to the 'To:' code block
    Captain Ru Guest

  6. #5

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    If the user clicks the "Login as Administrator" button, do you need the form to
    be submitted? Or can you just direct the 'rightFrame' target at:
    EMP_Data.cfm?EMPID=#ID#.

    Stated another way, do the username/password fields need to be passed on if
    the user clicks the "button" button?

    BSterner Guest

  7. #6

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    Let's see,
    how it works now is if a user clicks the last name field displayed from the
    database (shown in first post under 'Working') the login fields ('To:') will be
    displayed in the rightframe. I want to disable that but have the login fields
    displayed in the right frame when the user clicks ''login as administrator''.
    It's not meant to pass anything, just 'call' that login field.

    Captain Ru Guest

  8. #7

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    Gotcha. Try this.

    <input type = "button" value = "Login as Administrator" onclick = "javascript:parent.rightFrame.location.href='EMP_D ata.cfm?EMPID=#ID#';">

    BSterner Guest

  9. #8

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    hmmm....
    <input type = "button" value = "Login as Administrator" onclick =
    "javascript:parent.rightFrame.location.href='EMP_D ata.cfm?EMPID=#ID#';">

    that gave me this:

    Error Occurred While Processing Request
    File not found: /emp/Tool_Menu/EMP_Data.cfm


    Please try the following:
    Check the ColdFusion documentation to verify that you are using the correct
    syntax.
    Search the Knowledge Base to find a solution to your problem.


    Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Installed by
    Symantec Package; .NET CLR 1.1.4322)
    Remote Address xxxxxxxxxxxxxxxxxxx
    Referrer [url]http://fbak.firstbankak.com/emp/index.htm[/url]
    Date/Time 27-Jul-05 02:39 PM

    Stack Trace (click to expand)

    the file i am modifying is emp_tools in the emp/tools_menu folder. emp_data is
    in the emp directory.


    Captain Ru Guest

  10. #9

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    Then change the path to whatever matches your directory structure. In your
    case looks like it should be something like...

    location.href='/emp/EMP_Data.cfm?EMPID=#ID#''

    This assumes 'emp' resides just under your site root and 'EMP_Date.cfm' just
    under than.

    Make sense?





    BSterner Guest

  11. #10

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    I changed the path to "../emp_data.cfm"

    Here's the thing. With the old way, clicking the last name collects the
    #emp_id# from the database (from a query) and sets it equal to ID. This then
    puts the employee information in the frame. The login then allows a person to
    login and edit the information.

    Here's what i set the code to:
    onclick = "window.open('../EMP_Data.cfm?EMPID=#ID#')"

    I now get an error executing database query error because when clicked from
    the button, no #emp_id# is taken, set to ID, and passed.

    Now I am trying to figure out a solution for this current setup.

    The javascript code you mentioned above gave me an undefined javascript
    'windows debug script' prompt

    Captain Ru Guest

  12. #11

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    Post the code for all the frames, including the pop up as well as the master frame set plz.
    BSterner Guest

  13. #12

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    Ok, here's the new situation, code will follow.

    1. index.htm contains emp_tools (emp/tools_menu/emp_tools.cfm). this contains
    some search fields and the ADMIN LOGON button.

    2. below that sits emp_list.cfm (emp/emp_list.cfm). this contains the
    populated table read from a database. originally it contained the link to the
    embedded login. it's no longer there.

    3. emp_data.cfm (emp/emp_data.cfm) sits in the right frame across emp_list.cfm
    when called by clicking an employees last name from emp_list.

    4. emp_input.cfm is what is shown in the right frame when logged on as admin
    to edit the fields from the emp_list.

    Here's what I have now.
    The login code is:
    <input name="button" type = "button" onClick =
    "window.open('../adminlogin.cfm')" value = "Login as Administrator">
    I would like to change it to stay in the right frame first, then disappear
    when logged in.

    I created a new .cfm (adminlogin.cfm) to hold the login code:

    <cfform action="index.htm?login=Yes" name="Add_Emp">
    <table width="240" bordercolor="000000" bordercolorlight="000000"
    bordercolordark="000000" border="1" cellpadding="0" cellspacing="0">
    <tr>
    <th>Login ID</th><td><cfinput type="password" name="Login_ID_Input"
    required="yes" message="You must supply a login ID"></td>
    </tr>
    <tr>
    <th>Password</th><td><cfinput type="password" name="Password_Input"
    required="yes" message="You must supply a password"></td>
    </tr>
    <tr>
    <td colspan="2" align="center"><input type="submit" name="submit"
    value="enter"></td>
    </tr>
    </table>
    </cfform>

    I will enter the emp_data.cfm below



    Captain Ru Guest

  14. #13

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    As you can see some portions have been commented out. the login form is placed
    on the new adminlogin.cfm

    <cfparam name="Edit" default="No">
    <cfparam name="EMPEdit" default="No">
    <cfparam name="SaveEMP" default="No">
    <cfparam name="DeleteEMP" default="No">
    <cfparam name="login" default="No">
    <cfparam name="logOut" default="No">
    <cfparam name="session.loggedin" default="No">

    <title>Employee Data</title>
    <link rel="stylesheet" type="text/css" href="CSS/emp.css">

    <cfif Logout is 'Yes'>
    <cfset session.loggedin = 'No'>
    </cfif>

    <cfif login is 'Yes'>
    <cfif #Login_ID_Input# is 'xxxxxxxxxxxx' or #Login_ID_Input# is 'xxxxxxxx'
    and Password_Input is 'xxxxxxxxxxx'>
    <cfset session.loggedin = 'Yes'>
    <cfset EMPEdit = 'Yes'>
    <cfelse>
    Incorect username or password!
    </cfif>
    </cfif>


    <cfif #DeleteEMP# is 'Yes'>
    <cfquery name="Save_EMP_Data" datasource="EMP">
    DELETE FROM EmpTbl
    WHERE ID=#EMPID#
    </cfquery>
    <script language="javascript">
    alert("Employee has been Deleted")
    </script>
    </cfif>

    <cfif #SaveEmp# is 'yes'>
    <cfquery name="Save_EMP_Data" datasource="EMP">
    Update EmpTbl
    Set fname='#fname_Input#',
    lname='#lname_Input#',
    <cfif isdefined("dept_Input")>dept='#dept_Input#',</cfif>
    <cfif isdefined("branch_Input")>branch='#branch_Input#', </cfif>
    <cfif isdefined("title_Input")>title='#title_Input#',</cfif>
    <cfif isdefined("ext_Input")>ext='#ext_Input#',</cfif>
    <cfif isdefined("phone_Input")>phone='#phone_Input#',</cfif>
    <cfif isdefined("fax_Input")>fax='#fax_Input#',</cfif>
    <cfif isdefined("cellnumb_Input")>cellnumb='#cellnumb_In put#',</cfif>
    <cfif isdefined("dob_Input")>dob='#dob_Input#',</cfif>
    <cfif isdefined("hiredate_Input")>hiredate='#hiredate_In put#',</cfif>
    <cfif isdefined("officer_Input")>officer='#officer_Input #'</cfif>
    WHERE ID=#EMPID#
    </cfquery>
    </cfif>

    <CFQUERY NAME="EMP_Data" DATASOURCE="EMP">
    SELECT *
    FROM EmpTbl
    WHERE ID=#EMPID#
    </CFQUERY>

    <body leftmargin="0" topmargin="0" bottommargin="0" bgcolor="ffffff">



    <!---<cfif edit is 'Yes'>--->
    <!--- <cfform action="EMP_Data.cfm" name="Add_Emp">
    <table width="240" bordercolor="000000" bordercolorlight="000000"
    bordercolordark="000000" border="1" cellpadding="0" cellspacing="0">
    <tr>
    <th>Login ID</th><td><cfinput type="password" name="Login_ID_Input"
    required="yes" message="You must supply a login ID"></td>
    </tr>
    <tr>
    <th>Password</th><td><cfinput type="password" name="Password_Input"
    required="yes" message="You must supply a password"></td>
    </tr>
    <tr>
    <td colspan="2" align="center"><input type="submit" name="submit"
    value="enter"></td>
    </tr>
    </table>
    </cfform> --->
    <!---</cfif>--->
    <cfoutput query="EMP_Data">
    <cfform action="EMP_Data.cfm?SaveEmp=Yes&EMPID=#ID#" name="EMPEdit_Form">
    <table width="240" bordercolor="000000" bordercolorlight="000000"
    bordercolordark="000000" border="1" cellpadding="0" cellspacing="0">
    <TR>
    <TD colspan="2" align="center"><img style="cursor:hand"
    src="Images/employeepics/#empspicture#" height="133"
    onClick="window.open('Images/employeepics/#empspicture#','_NEW','TOOLBAR=NO,WIDT
    H=350,HEIGHT=400')"></TD>
    </TR>
    <TR bgcolor="ccffcc">
    <TH nowrap align="left">First Name</TD><TD nowrap width="100%"><cfif
    #session.loggedin# is 'yes'><cfinput type="text" name="fname_Input"
    value="#fname#"><cfelse>&nbsp;&nbsp;#fname#</cfif></TD>
    </TR>
    <TR bgcolor="ccffcc">
    <TH align="left" nowrap>Last Name</TD><TD nowrap><cfif #session.loggedin# is
    'Yes'><cfinput type="text" name="lname_Input"
    value="#lname#"><cfelse>&nbsp;&nbsp;#lname#</cfif></TD>
    </TR>
    <TR bgcolor="ccffcc">
    <TH align="left">Department</TD><TD nowrap><cfif #session.loggedin# is
    'Yes'><cfinput type="text" name="dept_Input"
    value="#dept#"><cfelse>&nbsp;&nbsp;#dept#</cfif></TD>
    </TR>
    <tr bgcolor="ccffcc">
    <TH align="left">Branch</TD><TD nowrap><cfif #session.loggedin# is
    'Yes'><cfinput type="text" name="branch_Input"
    value="#branch#"><cfelse>&nbsp;&nbsp;#branch#</cfif></TD>
    </tr>
    <TR bgcolor="ccffcc" >
    <TH align="left">Title</TD><TD nowrap><cfif #session.loggedin# is
    'Yes'><cfinput type="text" name="title_Input" value="#title#"><cfelse><cfif
    #title# is "">&nbsp;&nbsp;<cfelse>&nbsp;&nbsp;#title#</cfif></cfif></TD>
    </TR>
    <TR bgcolor="ccffcc">
    <TH align="left">Ext</TD><TD nowrap><cfif #session.loggedin# is
    'Yes'><cfinput type="text" name="ext_Input" value="#ext#"><cfelse><cfif #ext#
    is "">&nbsp;&nbsp;<cfelse>&nbsp;&nbsp;#ext#</cfif></cfif></TD>
    </TR>
    <TR bgcolor="ccffcc">
    <TH align="left">Phone</TD><TD nowrap><cfif #session.loggedin# is
    'Yes'><cfinput type="text" name="phone_Input" value="#phone#"><cfelse><cfif
    #phone# is "">&nbsp;&nbsp;<cfelse>&nbsp;&nbsp;#phone#</cfif></cfif></TD>
    </TR>
    <TR bgcolor="ccffcc">
    <TH align="left">Fax</TD><TD nowrap><cfif #session.loggedin# is
    'Yes'><cfinput type="text" name="fax_Input" value="#fax#"><cfelse><cfif #fax#
    is "">&nbsp;&nbsp;<cfelse>&nbsp;&nbsp;#fax#</cfif></cfif></TD>
    </TR>
    <TR bgcolor="ccffcc">
    <TH align="left">Cell</TD><TD nowrap><cfif #session.loggedin# is
    'Yes'><cfinput type="text" name="cellnumb_Input"
    value="#cellnumb#"><cfelse><cfif #cellnumb# is
    "">&nbsp;&nbsp;<cfelse>&nbsp;&nbsp;#cellnumb#</cfif></cfif></TD>
    </TR>
    <TR bgcolor="ccffcc">
    <TH align="left">Birthday</TD><TD nowrap><cfif #session.loggedin# is
    'Yes'><cfinput type="text" name="dob_Input" value="#dob#"><cfelse><cfif #dob#
    is "">&nbsp;&nbsp;<cfelse>&nbsp;&nbsp;#dob#</cfif></cfif></TD>
    </TR>
    <TR bgcolor="ccffcc">
    <TH align="left">Hire Date</TD><TD nowrap><cfif #session.loggedin# is
    'Yes'><cfinput type="text" name="hiredate_Input"
    value="#hiredate#"><cfelse><cfif #hiredate# is
    "">&nbsp;&nbsp;<cfelse>&nbsp;&nbsp;#hiredate#</cfif></cfif></TD>
    </TR>
    <TR bgcolor="ccffcc">
    <TH align="left"></TD>Officer?
    <TD nowrap><cfif #session.loggedin# is 'Yes'><cfinput type="text"
    name="officer_Input" value="#officer#"><cfelse><cfif #officer# is
    0>&nbsp;&nbsp;No<cfelse>&nbsp;&nbsp;Yes</cfif></cfif></TD>
    </TR>
    <cfif #session.loggedin# is 'Yes'>
    <tr>
    <td colspan="2" align="center"><input type="submit" value="save"><input
    type="button" value="Delete" onClick="DeleteEMP()"><input type="button"
    name="logout" value="Logout"
    onClick="window.open('EMP_Data.cfm?Logout=Yes&EMPI D=#ID#','rightFrame')"></td>
    </tr>
    </cfif>
    </cfform>
    <script language="javascript">
    function DeleteEMP()
    {
    var where_to= confirm("Do you really want to go to this page??");
    if (where_to== true)
    {window.open('EMP_Data.cfm?DeleteEMP=Yes&EMPID=#ID #','rightFrame');
    window.open('Emp_list.cfm','mainFrame');
    }
    else
    {
    }
    }
    </SCRIPT>

    </cfoutput>
    </table>

    </body>

    Captain Ru Guest

  15. #14

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    quick question:

    <input name="button" type = "button" onClick =
    "window.open('../adminlogin.cfm')" value = "Login as Administrator">


    how do i change the onclick event to open in the frame, not an open window? i
    don't know the correct syntax

    Captain Ru Guest

  16. #15

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    Just like I showed you above....

    <input name="button" type = "button" onClick =
    "javascript:parent.rightFrame.location.href='. ./adminlogin.cfm'" value = "Login
    as Administrator">

    If you want, you can zip and [email]joenobody720@excite.com[/email] ALL your files. Every
    frame page and the page with the <frame> and <frameset> logic. I think it will
    be easier than trying to work through it like this.

    BSterner Guest

  17. #16

    Default Re: Using Input Type Button to link to Frame Login. NeedHelp!!

    niiiice! it works now
    I'll email you the rest of the message
    Captain Ru Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139