XF 2.0 How to use xf:numberboxrow

AndyB

Well-known member
In an add-on I'm creating, I have the following input page where a member selects the Quantity.

1539259717354.webp

The Quantity value is entered each time the form is displayed, so I don't need to populate the Quantity with any previous value. What is the correct template and PHP code to use in order to use the xf:numberboxrow.

The following code is not working.

Template code:
Code:
<xf:numberboxrow name="quantity" value="" min="1"
    label="{{ phrase('shoppingcart_quantity') }}" />


PHP code:
PHP:
$quantity = $this->filter('quantity', 'uint');

Thank you.
 
In an add-on I'm creating, I have the following input page where a member selects the Quantity.

View attachment 185264

The Quantity value is entered each time the form is displayed, so I don't need to populate the Quantity with any previous value. What is the correct template and PHP code to use in order to use the xf:numberboxrow.

The following code is not working.

Template code:
Code:
<xf:numberboxrow name="quantity" value="" min="1"
    label="{{ phrase('shoppingcart_quantity') }}" />


PHP code:
PHP:
$quantity = $this->filter('quantity', 'uint');

Thank you.

The bar with the checkout button is supposed to be touching the rest of the form, so something is wrong in another part of your markup. Are all of your inputs inside of the <xf:form tag with all of the correct classes in the correct locations?
 
Hi Jake,

Thank you kindly for helping. You nailed it, the code is working perfectly, I just had another variable in a different area preventing me from seeing results.
 
Top Bottom