Spinbox / checkbox admin template combo Question

[xFv]

Well-known member
I am trying to get this code to have the spinbox value remain the same after I deselect the checkbox.
As it stands now, it resets itself back to 1 which is the minimum.


Capture2.webp
Capture3.webp

HERE IS MY CODE:
Code:
<input type="hidden" name="checkboxes[]" value="{$property.property_definition_id}" />
<xen:checkboxunit label="">
    <xen:option name="_null_" selected="{$property.propertyValueScalar}"
        label="{$property.title}"
        title="{xen:if $debugMode, $property.property_name}">
        <xen:hint>{xen:if $debugMode, $property.property_name}</xen:hint>
        <xen:spinbox name="properties[{$property.property_definition_id}]"
             value="{$property.propertyValueScalar}" step="1" min="1" max="1000" />
    </xen:option>
    <xen:explain>{$property.description}</xen:explain>
    <xen:html>
       <xen:include template="style_property_unit_extra">
       <xen:set var="$reset">{xen:phrase reset}</xen:set></xen:include>
    </xen:html>
</xen:checkboxunit>

I have exhausted my knowledge trying to figure this out.
Any help is much appreciated...
 
Last edited:
When an input is disabled, it's not submitted to the server. As such, it may be slightly difficult to do this. You may be able to pass a hidden input with the same name as the spinbox in to do this. Make sure the hidden input comes before the spinbox in the HTML as the submission order is generally the HTML order.
 
Top Bottom