[jQuery] Best way to toggle a form field value

[jQuery] Best way to toggle a form field value

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=605590014-21082008><FONT face=Arial size=2>I'm storing a
boolean in a hidden field, and I'd like to flip it's value when someone clicks a
link. Here's the function I've got currently:</FONT></SPAN></DIV>
<DIV><SPAN class=605590014-21082008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=605590014-21082008><FONT face=Arial size=2>function
toggleInput($el) {<BR>    // get the ID of the element being
passed in<BR>    var id = $el.attr('id');<BR>   
// get form element<BR>    var $formEl = $('input[name=' + id +
']');<BR>    // get the current value of the selected form
field<BR>    var value = $formEl.val();<BR>    //
set the new value <BR>   
$formEl.val(!value);<BR>   
alert(value);<BR>}</FONT></SPAN></DIV>
<DIV><SPAN class=605590014-21082008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=605590014-21082008><FONT face=Arial size=2>I seem to recall a
way to invert the value in one line, but it's eluding me at this time. Can
someone help me out?</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV align=left><SPAN style="FONT-SIZE: 14px"><B><FONT face="Century Gothic">
<DIV align=left><SPAN class=159130414-05012007><FONT face=Arial size=2><SPAN
class=159130414-05012007><FONT face=Arial
size=2>____________________________________</FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=159130414-05012007><FONT face=Arial size=2><SPAN
class=159130414-05012007></SPAN></FONT></SPAN> </DIV>Andy
Matthews<BR></FONT></B></SPAN><SPAN style="FONT-SIZE: 11px"><FONT
face="Century Gothic"><SPAN
style="FONT-SIZE: 8.5pt; FONT-FAMILY: 'Century Gothic'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-no-proof: yes">Senior
ColdFusion Developer</SPAN><BR></FONT></SPAN><SPAN style="FONT-SIZE: 11px"><FONT
face="Century Gothic"><FONT color=#808080><SPAN
style="FONT-SIZE: 11px"></SPAN><IMG alt="" hspace=0
src="cid:605590014@21082008-1A6C" align=baseline border=0></FONT><BR>Office:
 615.627.9747<BR>Fax:  615.467.6249</FONT></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 11px"><FONT face="Century Gothic"><A
href="http://www.dealerskins.com/">www.dealerskins.com</A></FONT></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 11px"></SPAN> </DIV>
<DIV><SPAN style="FONT-SIZE: 11px"><SPAN style="FONT-SIZE: 12px"><FONT
face="Century Gothic">Total customer satisfaction is my number 1 priority! If
you are not completely satisfied with the service I have provided, please let me
know right away so I can correct the problem, or notify my manager <FONT
color=#fe6500>Aaron West</FONT> at <FONT
color=#0000ff><U>awest@dealerskins.com</U></FONT>.</FONT></SPAN></SPAN></DIV>
<DIV> </DIV></BODY></HTML>