Set Bounds on Form Number Inputs

Is there a way to set an expected input value range on the form item? e.g. A user should input an angle that is between 0 and 90 degrees. Values outside of this range would be rejected when submit is chosen similar to a non-value in a required field.

Zach

Sorry - this is not available within a form node.
You can do this using the normal numeric picker.
You can use a join node set to manual create key value object to wait for several widgets and to create a single msg like a form if you like.

Thanks dceejay. That's helpful. I'll investigate the join node and see what I can come up with.

Has this been put up as a suggested improvement as would have thought basic expectation for a form along with the ability set a default value. Simple addition to handle all data types would be the ability to give a regex expression for validations

It has been suggested above... Just waiting for someone to write the code and submit the pull request.

1 Like

Has been this option added?
Or is there any other way how to do this?

no - still waiting for volunteers.

There is always another option
example

[{"id":"98d7fb26.26d25","type":"ui_form","z":"c791cbc0.84f648","name":"","label":"","group":"2d4fe667.28f8ba","order":23,"width":0,"height":0,"options":[{"label":"input","value":"input","type":"number","required":true,"rows":null},{"label":"name","value":"name","type":"text","required":true,"rows":null}],"formValue":{"input":"","name":""},"payload":"","submit":"submit","cancel":"cancel","topic":"topic","topicType":"msg","splitLayout":"","className":"","x":210,"y":4080,"wires":[["30579684.62f662"]]},{"id":"30579684.62f662","type":"switch","z":"c791cbc0.84f648","name":"","property":"payload.input","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"10","v2t":"num"},{"t":"regex","v":"[^A-Za-z ]","vt":"str","case":false},{"t":"else"}],"checkall":"false","repair":false,"outputs":3,"x":380,"y":4080,"wires":[["d7873c61.99e668"],["d51abdca.88ee18"],["a5648c52.d01338","605acf77.c5b598"]]},{"id":"d7873c61.99e668","type":"change","z":"c791cbc0.84f648","name":"","rules":[{"t":"set","p":"error","pt":"msg","to":"Error name a-z and space only","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":4180,"wires":[["f11e6c50.61f3d8","98d7fb26.26d25"]]},{"id":"d51abdca.88ee18","type":"change","z":"c791cbc0.84f648","name":"","rules":[{"t":"set","p":"error","pt":"msg","to":"Error input not between 0 and 10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":4220,"wires":[["f11e6c50.61f3d8","98d7fb26.26d25"]]},{"id":"a5648c52.d01338","type":"change","z":"c791cbc0.84f648","name":"","rules":[{"t":"set","p":"error","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":4020,"wires":[["f11e6c50.61f3d8"]]},{"id":"605acf77.c5b598","type":"debug","z":"c791cbc0.84f648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":750,"y":4100,"wires":[]},{"id":"f11e6c50.61f3d8","type":"ui_text","z":"c791cbc0.84f648","group":"2d4fe667.28f8ba","order":24,"width":0,"height":0,"name":"","label":"","format":"{{msg.error}}","layout":"row-spread","className":"","x":810,"y":4200,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":1,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
1 Like

Thx for your reply. I found out I need more complicated inputs in the form then the standard (dropdown menu etc.) so I choose to use UI_template node.

But I can't get the form working in there ... I started an issue: Trying to create Angular Form inside UI template