Log in

View Full Version : Another coding problem



Grimmbart
May 7th, 2009, 09:59
Hi.

In a Numberfield


<numberfield name="Force_valeur" >
<bounds rect="86,226,24,16" />
<font name="smallcontrol" />
<hideonvalue value="0" />
<description field="Force_nom" />
<tabtarget> <next>Charisme_valeur</next> <prev>Dexterite_valeur</prev></tabtarget>
</numberfield>

i want to set Min and max value
Min = 1 and Max = 5. How can i do this ?

Ikael
May 7th, 2009, 10:09
use the following script in the numberfield to set number limitation.
It simply sets the value to max or min if they happen to be greater or lesser then given max/min value.



<script>
function onValueChanged()
if getValue() &gt; 5 then
setValue(5)
elseif getValue() &lt; 1 then
setValue(1)
end
end
</script>