nerdcore
MIS
- Jan 23, 2003
- 26
I don't know exactly which forum to post this in but since I'm using coldfusion to build this app I'm trying here first.
I have an MS SQL Server 2000 backend. I am developing a front end using coldfusion. I am using normal HTML input tags rather than CF tags for the fields. I am BRAND NEW to cold fusion so bear with me.
I have a form which displays a contact record for a person. This record contains typical name, address, phone, etc. and then a boolean field for "Same_Address" which tells me whether this contact has the same address as the company to which he belongs. This Same_Address field is of type 'bit' in the SQL Server and has a default value there of (0).
But when I add an <input type="checkbox" value="#Same_Address#"> to my page it does not show up. It is always blank. So I tried using a cfif statement to populate it which works except I would think that there is an easier way to do this:
<cfif #Same_Address# eq '1'>
<td><input type="checkbox" checked name="Same_Address" value="#Same_Address#"></td>
<cfelse>
<td><input type="checkbox" name="Same_Address" value="#Same_Address#"></td>
</cfif>
I ask because my next project is to make another page that has about 100 checkboxes on it and would hate to write 100 cfif statements to do this. Also in the SQL server the actual values in the field are 0 and -1 while they appear to be 0 and 1 in ColdFusion.
I also would like to know where i would put script code that would check the value of the Same_Address checkbox and disable editing of the address fields if it was checked (and likewise enable those fields if Same_Address was not checked). I can put code in the onClick even of the checkbox but that does not run on 'startup' of the form and putting it in the onLoad event of the <body> tag doesn't work either.
Thanks in advance, and help is greatly appreciated!
I have an MS SQL Server 2000 backend. I am developing a front end using coldfusion. I am using normal HTML input tags rather than CF tags for the fields. I am BRAND NEW to cold fusion so bear with me.
I have a form which displays a contact record for a person. This record contains typical name, address, phone, etc. and then a boolean field for "Same_Address" which tells me whether this contact has the same address as the company to which he belongs. This Same_Address field is of type 'bit' in the SQL Server and has a default value there of (0).
But when I add an <input type="checkbox" value="#Same_Address#"> to my page it does not show up. It is always blank. So I tried using a cfif statement to populate it which works except I would think that there is an easier way to do this:
<cfif #Same_Address# eq '1'>
<td><input type="checkbox" checked name="Same_Address" value="#Same_Address#"></td>
<cfelse>
<td><input type="checkbox" name="Same_Address" value="#Same_Address#"></td>
</cfif>
I ask because my next project is to make another page that has about 100 checkboxes on it and would hate to write 100 cfif statements to do this. Also in the SQL server the actual values in the field are 0 and -1 while they appear to be 0 and 1 in ColdFusion.
I also would like to know where i would put script code that would check the value of the Same_Address checkbox and disable editing of the address fields if it was checked (and likewise enable those fields if Same_Address was not checked). I can put code in the onClick even of the checkbox but that does not run on 'startup' of the form and putting it in the onLoad event of the <body> tag doesn't work either.
Thanks in advance, and help is greatly appreciated!