[Phpwm] [OT] Any ideas how to do this?

Greg Jones greg.jones at gmail.com
Thu May 25 18:45:39 BST 2006

> I have two text boxes within a form and a radio button.
> There is a ratio between the values of the starting values within the  
> text
> boxes, which is actually the aspect ratio of an image. The function of  
> the
> radio button is to say overide the aspect ratio.
> If the radio button isn't set and one of the text box values is altered I
> want the value of the second box to alter to the same (interger value)
> ratio. If the radio button is set I dont want the value of the second  
> box to
> alter.

Some code for you at:

It assumes the text-areas have values in them to start with, and initially  
this is the ratio used for further changes.
If you change one value with the checkbox unticked, then the ratio is  
recalculated, so upon re-ticking it, this new ratio is used for  
calculations (experiment and see if that doesn't make sense...).

As one of the comments mentions, if this is going in anything larger than  
<something very small>, then using window.onload directly is probably not  
a good idea.

Greg Jones

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

More information about the Phpwm mailing list