Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox

Status
Not open for further replies.

8430

Programmer
Feb 23, 2005
3
US
I have a session and the values of the checkboxes are stored in the session. Whenever I click a checkbox I change the session value of just 1 checkbox and submit the form, but after submission it is found that all the checkboxes values are changed. here is my code.

<cfinclude template="StoreSession.cfm">
<cfquery name="getCheckListInfo" datasource="mktngJobReq">
select DISTINCT ProjectManager from Checklist
</cfquery>
<cfquery name="getCheckListInfo1" datasource="mktngJobReq">
select DISTINCT GraphicsSpecialist from Checklist
</cfquery>
<cfif session.newJobReq.PID neq ''>
<cfquery name="get_programmer_info_session" datasource="mktngJobReq">
select * from Programmers where PID = #session.newJobReq.PID#
</cfquery>
</cfif>
<cfif session.newJobReq.PRID neq ''>
<cfquery name="get_pr_info_session" datasource="mktngJobReq">
select * from PRs where PRID = #session.newJobReq.PRID#
</cfquery>
</cfif>
<cfif session.newJobReq.JobCode is not " ">
<cfquery name="job_type1" datasource="mktngJobReq">
select * from JobType where JobCode = '#session.newJobReq.JobCode#'
</cfquery>
</cfif>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>New AdCheckList </title>
<script language="javascript">
function samePage() {
document.NewAdCheckListInfo.action = 'NewAdCheckList.cfm';
document.NewAdCheckListInfo.submit();
}
function samePage1() {
<cfif session.newAdCheckListInfo.done_task1 is 0>
<cfset session.newAdCheckListInfo.done_task1 = 1>
<cfelse>
<cfset session.newAdCheckListInfo.done_task1 = 0>
</cfif>
document.NewAdCheckListInfo.action = 'NewAdCheckList.cfm';
document.NewAdCheckListInfo.submit();
}
function samePage2() {
<cfif session.newAdCheckListInfo.done_task2 is 0>{
<cfset session.newAdCheckListInfo.done_task2 = 1>
}
<cfelse>{
<cfset session.newAdCheckListInfo.done_task2 = 0>
}
</cfif>
document.NewAdCheckListInfo.action = 'NewAdCheckList.cfm';
document.NewAdCheckListInfo.submit();
}
function samePage3() {
<cfif session.newAdCheckListInfo.done_task3 is 0>{
<cfset session.newAdCheckListInfo.done_task3 = 1>
}
<cfelse>{
<cfset session.newAdCheckListInfo.done_task3 = 0>
}
</cfif>
document.NewAdCheckListInfo.action = 'NewAdCheckList.cfm';
document.NewAdCheckListInfo.submit();
}
function samePage5() {
<cfif session.newAdCheckListInfo.done_task5 is 0>{
<cfset session.newAdCheckListInfo.done_task5 = 1>
}
<cfelse>{
<cfset session.newAdCheckListInfo.done_task5 = 0>
}
</cfif>
document.NewAdCheckListInfo.action = 'NewAdCheckList.cfm';
document.NewAdCheckListInfo.submit();
}
function samePage6() {
<cfif session.newAdCheckListInfo.done_task6 is 0>{
<cfset session.newAdCheckListInfo.done_task6 = 1>
}
<cfelse>{
<cfset session.newAdCheckListInfo.done_task6 = 0>
}
</cfif>
document.NewAdCheckListInfo.action = 'NewAdCheckList.cfm';
document.NewAdCheckListInfo.submit();
}
function samePage8() {
<cfif session.newAdCheckListInfo.done_task8 is 0>{
<cfset session.newAdCheckListInfo.done_task8 = 1>
}
<cfelse>{
<cfset session.newAdCheckListInfo.done_task8 = 0>
}
</cfif>
document.NewAdCheckListInfo.action = 'NewAdCheckList.cfm';
document.NewAdCheckListInfo.submit();
}
function samePage9() {
<cfif session.newAdCheckListInfo.done_task9 is 0>{
<cfset session.newAdCheckListInfo.done_task9 = 1>
}
<cfelse>{
<cfset session.newAdCheckListInfo.done_task9 = 0>
}
</cfif>
document.NewAdCheckListInfo.action = 'NewAdCheckList.cfm';
document.NewAdCheckListInfo.submit();
}
function samePage11() {
<cfif session.newAdCheckListInfo.done_task11 is 0>{
<cfset session.newAdCheckListInfo.done_task11 = 1>
}
<cfelse>{
<cfset session.newAdCheckListInfo.done_task11 = 0>
}
</cfif>
document.NewAdCheckListInfo.action = 'NewAdCheckList.cfm';
document.NewAdCheckListInfo.submit();
}
function RemoveFields()
{
//document.NewAdCheckListInfo.method = "post";
document.NewAdCheckListInfo.action = 'NewAdCheckList.cfm';
document.NewAdCheckListInfo.submit();
}
function submitInfo1() {
document.NewAdCheckListInfo.action = 'NewOpenUnivJobReq.cfm';
document.NewAdCheckListInfo.submit();
}
function submitInfo2() {
document.NewAdCheckListInfo.action = 'NewMaterialCosts.cfm';
document.NewAdCheckListInfo.submit();
}
function submitInfo3() {
document.NewAdCheckListInfo.action = 'NewMailingInfo.cfm';
document.NewAdCheckListInfo.submit();
}
function submitInfo4() {
document.NewAdCheckListInfo.action = 'NewAdInfo.cfm';
document.NewAdCheckListInfo.submit();
}
</script>
</head>
<body background="include/pics/1.jpg">
<form name="NewAdCheckListInfo" method="post"><!--- action="AddNewJobReqInfo.cfm"--->
<input type="hidden" name="PageID" value="NCIA">
<table border="1" bordercolorlight="gold" cellpadding="2" cellspacing="0" bgcolor="#cccccc">
<tr>
<td bgcolor="#ffffff">
<script webstyle3>document.write('<scr'+'ipt src="xaramenu.js">'+'</scr'+'ipt>');document.write('<scr'+'ipt src="include/sidebar/left_menu.js">'+'</scr'+'ipt>');/*img src="include/sidebar/left_menu.gif" moduleid="JobRequestMenu1 (Project)\left_menu_off.xws"*/</script>
</td>
<td bgcolor="#ffffcc">
<table border="1" bordercolorlight="gold" cellpadding="2" cellspacing="0" bgcolor="#ffffcc">
<tr>
<td bgcolor="#cccccc"><input type="button" value="General Information" onClick="submitInfo1()"></td>
<td bgcolor="#CCCCCC"><input type="button" value="Promotion" onClick="submitInfo4()"></td>
<td bgcolor="#cccccc"><input type="button" value="Material Costs" name="P1" onClick="submitInfo2()"></td>
<td bgcolor="#99CC99">Ad Checklist</td>
</tr>
</table>
<table border="1" cellpadding="2" cellspacing="0" bgcolor="#ffffcc">
<tr>
<td bgcolor="#ffffcc">
<table>
<tr>
<td>Job Contacts:</td>
<td>
<input name="Contact1" type="text" value="<cfif session.newJobReq.PID neq ''><cfoutput query="get_programmer_info_session">#FirstName# #LastName#</cfoutput></cfif>">
and
<input name="Contact2" type="text" value="<cfif session.newJobReq.PRID neq ''><cfoutput query="get_pr_info_session">#FirstName# #LastName#</cfoutput></cfif>">
</td>
</tr>
<tr>
<td align="right" colspan="2">Project Manager:
<select name="ProjectManager">
<cfoutput>
<cfif IsDefined("session.newAdCheckListInfo.ProjectManager") and session.newAdCheckListInfo.ProjectManager is not "" and session.newAdCheckListInfo.ProjectManager is not 0>
<option value="#session.newAdCheckListInfo.ProjectManager#" selected>#session.newAdCheckListInfo.ProjectManager#</option>
<option value="0">----</option>
<cfelse>
<option value="0" selected>----</option>
</cfif>
</cfoutput>
<cfoutput query="getCheckListInfo"><cfif ProjectManager IS NOT ""><option value="#ProjectManager#">#ProjectManager#</option></cfif></cfoutput>
</select>
</td>
</tr>
</table>
</td>
<td>
<table width="100%" bgcolor="#ffffcc">
<tr>
<td>Graphics Specialist:</td>
<td>
<select name="GraphicsSpecialist">
<cfoutput>
<cfif IsDefined("session.newAdCheckListInfo.GraphicsSpecialist") and session.newAdCheckListInfo.GraphicsSpecialist is not "" and session.newAdCheckListInfo.GraphicsSpecialist is not 0>
<option value="#session.newAdCheckListInfo.GraphicsSpecialist#" selected>#session.newAdCheckListInfo.GraphicsSpecialist#</option>
<option value="0">----</option>
<cfelse>
<option value="0">----</option>
</cfif>
</cfoutput>
<cfoutput query="getCheckListInfo1"><cfif GraphicsSpecialist IS NOT ""><option value="#GraphicsSpecialist#">#GraphicsSpecialist#</option></cfif></cfoutput>
</select>
</td>
</tr>
<tr>
<td colspan="2">Copy:
<select name="Copy" onChange="RemoveFields()">
<cfif isDefined("session.newAdCheckListInfo.Copy") and session.newAdCheckListInfo.Copy is 1 and not isDefined("form.Copy")>
<option value="1" selected>YES</option>
<option value="0">NO</option>
<cfelseif isDefined("session.newAdCheckListInfo.Copy") and session.newAdCheckListInfo.Copy is 0 and not isDefined("form.Copy")>
<option value="0" selected>NO</option>
<option value="1">YES</option>
<cfelseif isDefined("form.Copy") and form.Copy is 1>
<option value="1" selected>YES</option>
<option value="0">NO</option>
<cfelseif isDefined("form.Copy") and form.Copy is 0>
<option value="0" selected>NO</option>
<option value="1">YES</option>
<cfelse>
<option value="1" selected>YES</option>
<option value="0">NO</option>
</cfif>
</select>
</td>
</tr>
</table>
</td>
</tr>
</table>
<cfoutput>
<table bgcolor="ffffcc">
<tr bgcolor="99CC99">
<td colspan="2">Task</td><td>Meeting Date</td><td>Deadline</td><td>Start Date</td><td>Date Completed</td>
</tr>
<tr>
<td>
Project Manager
</td>
<td>
<input type="checkbox" name="done_task1" value="#session.newAdCheckListInfo.done_task1#" <cfif isDefined("session.newAdCheckListInfo.done_task1") and session.newAdCheckListInfo.done_task1 is 1>checked<cfelse>unchecked</cfif> onClick="samePage1()">#session.newAdCheckListInfo.done_task1#
Initial Meeting</td>
<td>
<input name="meetingdate1" type="text" value="#session.newAdCheckListInfo.meetingdate1#">
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input name="datedone1" type="text" value="#session.newAdCheckListInfo.datedone1#"></td>
</tr>
<tr bgcolor="FFFF99">
<td>
Marketing Staff
</td>
<td>
<cfif (isDefined("form.Copy") and form.Copy is 1) or (not isDefined("form.Copy") and session.newAdCheckListInfo.CopyColor is 0) or (not isDefined("form.Copy") and session.newAdCheckListInfo.Copy is 1) >
<input name="done_task2" type="checkbox" value="#session.newAdCheckListInfo.done_task2#" <cfif isDefined("session.newAdCheckListInfo.done_task2") and session.newAdCheckListInfo.done_task2 is 1>checked<cfelse>unchecked</cfif> onClick="samePage2()">#session.newAdCheckListInfo.done_task2#
</cfif>
Marketing meeting w/ client
</td>
<td><input name="meetingdate2" type="text" value="#session.newAdCheckListInfo.meetingdate2#">
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>
<!---<cfif (isDefined("form.Copy") and form.Copy is 1) or (not isDefined("form.Copy") and session.newAdCheckListInfo.CopyColor is 0) or (not isDefined("form.Copy") and session.newAdCheckListInfo.Copy is 1)>--->
<input name="datedone2" type="text" value="#session.newAdCheckListInfo.datedone2#">
<!---</cfif>&nbsp;---></td>
</tr>
<tr>
<td>
Allison
</td>
<td>
<input name="done_task3" type="checkbox" id="done_task3" value="#session.newAdCheckListInfo.done_task3#" <cfif isDefined("session.newAdCheckListInfo.done_task3") and session.newAdCheckListInfo.done_task3 is 1>checked<cfelse>unchecked</cfif> onClick="samePage3()">#session.newAdCheckListInfo.done_task3#
Copy outline for approval</td>
<td>&nbsp;

</td>
<td>
<input name="deadline3" type="text" value="#session.newAdCheckListInfo.deadline3#">
</td>
<td>
<input name="startdate3" type="text" value="#session.newAdCheckListInfo.startdate3#">
</td>
<td><input name="datedone3" type="text" value="#session.newAdCheckListInfo.datedone3#"></td>
</tr>
<tr bgcolor="FFFF99">
<td>Allison</td>
<td><cfif (isDefined("form.Copy") and form.Copy is 1) or (not isDefined("form.Copy") and session.newAdCheckListInfo.CopyColor is 0) or (not isDefined("form.Copy") and session.newAdCheckListInfo.Copy is 1)>
<input name="done_task5" type="checkbox" value="#session.newAdCheckListInfo.done_task5#" <cfif isDefined("session.newAdCheckListInfo.done_task5") and session.newAdCheckListInfo.done_task5 is 1>checked<cfelse>unchecked</cfif> onClick="samePage5()">
</cfif>
Copy to Proof </td>
<td>&nbsp;</td>
<td>
<cfif (isDefined("form.Copy") and form.Copy is 1) or (not isDefined("form.Copy") and session.newAdCheckListInfo.CopyColor is 0) or (not isDefined("form.Copy") and session.newAdCheckListInfo.Copy is 1)>
<input name="deadline5" type="text" value="#session.newAdCheckListInfo.deadline5#">
</cfif>&nbsp;</td>
<td>
<cfif (isDefined("form.Copy") and form.Copy is 1) or (not isDefined("form.Copy") and session.newAdCheckListInfo.CopyColor is 0) or (not isDefined("form.Copy") and session.newAdCheckListInfo.Copy is 1)>
<input name="startdate5" type="text" value="#session.newAdCheckListInfo.startdate5#">
</cfif>&nbsp;</td>
<td><input name="datedone5" type="text" value="#session.newAdCheckListInfo.datedone5#"></td>
</tr>
<tr>
<td>Graphics</td>
<td><input name="done_task6" type="checkbox" id="done_task6" value="#session.newAdCheckListInfo.done_task6#" <cfif isDefined("session.newAdCheckListInfo.done_task6") and session.newAdCheckListInfo.done_task6 is 1>checked<cfelse>unchecked</cfif> onClick="samePage6()">
2-3 samples/mockups for approval</td>
<td>&nbsp;

</td>
<td><input name="deadline6" type="text" value="#session.newAdCheckListInfo.deadline6#"></td>
<td><input name="startdate6" type="text" value="#session.newAdCheckListInfo.startdate6#"></td>
<td><input name="datedone6" type="text" value="#session.newAdCheckListInfo.datedone6#"></td>
</tr>
<tr bgcolor="FFFF99">
<td>Grpahics</td>
<td><cfif (isDefined("form.Copy") and form.Copy is 1) or (not isDefined("form.Copy") and session.newAdCheckListInfo.CopyColor is 0) or (not isDefined("form.Copy") and session.newAdCheckListInfo.Copy is 1)>
<input name="done_task8" type="checkbox" id="done_task8" value="#session.newAdCheckListInfo.done_task8#" <cfif isDefined("session.newAdCheckListInfo.done_task8") and session.newAdCheckListInfo.done_task8 is 1>checked<cfelse>unchecked</cfif> onClick="samePage8()">
</cfif>
Layout to proof </td>
<td>&nbsp;

</td>
<td><cfif (isDefined("form.Copy") and form.Copy is 1) or (not isDefined("form.Copy") and session.newAdCheckListInfo.CopyColor is 0) or (not isDefined("form.Copy") and session.newAdCheckListInfo.Copy is 1)><input name="deadline8" type="text" value="#session.newAdCheckListInfo.deadline8#">
</cfif>&nbsp;</td>
<td><cfif (isDefined("form.Copy") and form.Copy is 1) or (not isDefined("form.Copy") and session.newAdCheckListInfo.CopyColor is 0) or (not isDefined("form.Copy") and session.newAdCheckListInfo.Copy is 1)><input name="datedone8" type="text" value="#session.newAdCheckListInfo.startdate8#">
</cfif>&nbsp;</td>
<td><input name="datedone1" type="text" value="#session.newAdCheckListInfo.datedone8#"></td>
</tr>
<tr>
<td>Allison</td>
<td><input name="done_task9" type="checkbox" id="done_task9" value="#session.newAdCheckListInfo.done_task9#" <cfif isDefined("session.newAdCheckListInfo.done_task9") and session.newAdCheckListInfo.done_task9 is 1>checked<cfelse>unchecked</cfif> onClick="samePage9()">
Check client's comments </td>
<td>&nbsp;

</td>
<td><input name="deadline9" type="text" value="#session.newAdCheckListInfo.deadline9#"></td>
<td><input name="startdate9" type="text" value="#session.newAdCheckListInfo.startdate9#"></td>
<td><input name="datedone9" type="text" value="#session.newAdCheckListInfo.datedone9#"></td>
</tr>
<tr bgcolor="FFFF99">
<td>Project Manager</td>
<td><input name="done_task11" type="checkbox" id="done_task11" value="#session.newAdCheckListInfo.done_task11#" <cfif isDefined("session.newAdCheckListInfo.done_task11") and session.newAdCheckListInfo.done_task11 is 1>checked<cfelse>unchecked</cfif> onClick="samePage11()">
To Publication</td>
<td>&nbsp;
</td>
<td><input name="deadline11" type="text" value="#session.newAdCheckListInfo.deadline11#"></td>
<td>&nbsp;</td>
<td><input name="datedone11" type="text" value="#session.newAdCheckListInfo.datedone11#"></td>
</tr>
<tr>
<td align="center" colspan="5">
<input type="submit" value="Save" onClick="samePage()"></td>
</tr>
</table>
</cfoutput>
</td>
</tr>
</table>
</form>
</body>
</html>


Let me know asap.
Thanks a lot.
Vikram
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top