Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Captain Ru #1
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> <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
-
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... -
$_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.... -
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... -
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... -
<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... -
BSterner #2
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
-
Captain Ru #3
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
-
Captain Ru #4
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
-
BSterner #5
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
-
Captain Ru #6
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
-
BSterner #7
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
-
Captain Ru #8
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
-
BSterner #9
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
-
Captain Ru #10
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
-
BSterner #11
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
-
Captain Ru #12
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
-
Captain Ru #13
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> #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> #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> #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> #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 ""> <cfelse> #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 ""> <cfelse> #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 ""> <cfelse> #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 ""> <cfelse> #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
""> <cfelse> #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 ""> <cfelse> #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
""> <cfelse> #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> No<cfelse> 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
-
Captain Ru #14
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
-
BSterner #15
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
-
Captain Ru #16
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



Reply With Quote

