I need to display check boxes as 'ticked' in my edit function where
there is a corresponding value for them in the database.
In my new function a user can select between 1 and 4 tick boxes and I
need these ticked check boxes displayed back to them when they go in to
the edit function for that database item.
Most appreciated if anyone out there can help please?
Here's the code from the new function that sets up the database fields
from the check boxes - so I just need to display these as 'ticked' in my
edit function.
tr>
<td nowrap><font size="2" color="#9E0B0E">Agreement Type   <a
href="javascript:openNewWindow('http://security/transfers/transfer_help.htm')"><img
src="http://security/transfers/images/info.jpg" width="10" height="10"
border="0"></a></td>
<td colspan="2" nowrap><font size="2">
<input type="checkbox" name="transfer[agreement_1]" value="Y">Contract
   
<input type="checkbox" name="transfer[agreement_2]" value="Y">Data
Transfer Agreement    
<input type="checkbox" name="transfer[agreement_3]" value="Y">Data
Destruction Agreement   
<input type="checkbox" name="transfer[agreement_4]"
value="Y">Non-Disclosure Agreement   
</td>
</tr>
Currently my edit function is as below but I'm missing the bit to get
the boxes ticked.
<tr>
<td nowrap><font size="2" color="#9E0B0E">Agreement Type   <a
href="javascript:openNewWindow('http://security/transfers/transfer_help.htm')"><img
src="http://security/transfers/images/info.jpg" width="10" height="10"
border="0"></a></td>
<td colspan="2" nowrap><font size="2">
<input type="checkbox" name="transfer[agreement_1]" value=value="<%=
@transfers.agreement_1 if @transfers.agreement_1 %>">Contract  
 
<input type="checkbox" name="transfer[agreement_2]" value=value="<%=
@transfers.agreement_2 %>"">Data Transfer Agreement    
<input type="checkbox" name="transfer[agreement_3]" value="value="<%=
@transfers.agreement_3 %>"">Data Destruction Agreement   
<input type="checkbox" name="transfer[agreement_4]" value="value="<%=
@transfers.agreement_4%>"">Non-Disclosure Agreement   
</td>
</tr>
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---