<div>Hi!</div>
<div> </div>
<div>I made a quick and dirty example!</div>
<div> </div>
<div>HTH</div>
<div>Gerhard</div>
<div> </div>
<div> | formId |<br> formId := html nextId.<br> html form id: formId; <br> with: [html checkbox value: false; callback: [:v | set := v];<br> onClick: (html evaluator triggerForm: formId;</div>
<div> callback: [:script | script element id: 'text'; update: [:r | set ifTrue: [r text: 'My address']<br> ifFalse: [r text: '']] ]).<br> html textArea id: 'text'; with: [html text: 'Empty']].</div>
<div> </div>
<div><br><br> </div>
<div class="gmail_quote">On Sat, Mar 8, 2008 at 4:38 PM, Richard K Eng <<a href="mailto:richard.eng@rogers.com">richard.eng@rogers.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I'm puzzled how to use #updater. I'm trying to use a checkbox to add text to<br>a textArea input field. For example,...<br>
<br>renderBillingCheckboxAndAddressOn: html<br> html div<br> class: 'frow';<br> with:<br> [html break.<br> html paragraph:<br> [html checkbox<br> value: useShippingAddress;<br> callback: [:value | useShippingAddress := value];<br>
onClick: (html updater id: 'shipping';<br> callback: [:r | useShippingAddress := useShippingAddress not.<br> self renderBillingAddressOn: r] );<br> with: 'Use shipping address as billing address also']].<br>
html div<br> class: 'frow';<br> with:<br> [html span<br> class: 'formlabel';<br> with: [html text: 'Billing address'].<br> html span<br> class: 'forminput';<br> with: [self renderBillingAddressOn: html]]<br>
<br><br>This code works, but I'm sure it's not the right way to do things. The<br>reason I have the 'useShippingAddress := useShippingAddress not' nonsense is<br>because without it, I can't get #useShippingAddress to have the correct<br>
checkbox value in #renderBillingAddressOn:. The problem is,<br>#useShippingAddress only gets the correct checkbox value on form submission,<br>NOT upon invocation of #onClick:.<br><br>Ultimately, what I want is for #onClick: to use whatever value is selected<br>
by the form control, whether the control is a checkbox or radio button or<br>dropdown menu. This *has* to be doable, so the question is: HOW???<br><br>Regards,<br>Richard<br><br>_______________________________________________<br>
seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</blockquote></div><br>