Hi everyone, I'm rather new to Node-RED and I want to setup a page for me to key in details to reserve an item into a database.
What I had in mind was to key in the values through numbers of ui_text_input and ui_dropdown and have those value sent out through the ui_button. I've tried to refer to the following link: How to work with text input - #4 by Steve-Mcl but from what I've tried so far, it would only work with 1 input. I've tried using the join node and it doesn't lock the button if I leave it empty.
As for storing it into the database, I had an idea on how it worked, just need to solve this issue first and I'll see if I came across any other issues.
Many thanks in advance for your help.
[{"id":"e5e03e58.27ca4","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"63cf0874.749838","type":"ui_text_input","z":"e5e03e58.27ca4","name":"","label":"Product ID","tooltip":"","group":"bbfef042.d705a8","order":1,"width":0,"height":0,"passthru":true,"mode":"text","delay":"100","topic":"ProductID","topicType":"str","x":110,"y":120,"wires":[["72d7f269.7a04fc"]]},{"id":"2df5a02f.fefba8","type":"ui_text_input","z":"e5e03e58.27ca4","name":"","label":"Description","tooltip":"","group":"bbfef042.d705a8","order":1,"width":0,"height":0,"passthru":true,"mode":"text","delay":"100","topic":"ProductDescription","topicType":"str","x":110,"y":160,"wires":[["72d7f269.7a04fc"]]},{"id":"72d7f269.7a04fc","type":"join","z":"e5e03e58.27ca4","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":270,"y":140,"wires":[["3c4d0b13.1e4e5c","b2f87f4.7e35b8"]]},{"id":"3c4d0b13.1e4e5c","type":"debug","z":"e5e03e58.27ca4","name":"Form Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":430,"y":180,"wires":[]},{"id":"b2f87f4.7e35b8","type":"function","z":"e5e03e58.27ca4","name":"","func":"flow.set(\"Product\", msg.payload);\n\nvar msg1 = msg.payload.ProductID;\nvar msg2 = msg.payload.ProductDescription;\n\nif((msg1.length > 0) && (msg2.length > 0))\n{\n return{payload: msg.enabled}\n}\nelse\n{\n return{payload: msg.disabled}\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":140,"wires":[["453daf83.734f3","b0c78919.e89b2"]]},{"id":"453daf83.734f3","type":"ui_button","z":"e5e03e58.27ca4","name":"","group":"bbfef042.d705a8","order":2,"width":0,"height":0,"passthru":false,"label":"Submit","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Product","payloadType":"flow","topic":"","topicType":"str","x":580,"y":140,"wires":[["713c95a7.6aca74","ea846853.b80b58"]]},{"id":"713c95a7.6aca74","type":"debug","z":"e5e03e58.27ca4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":750,"y":140,"wires":[]},{"id":"ea846853.b80b58","type":"function","z":"e5e03e58.27ca4","name":"","func":"msg.payload += \" was added\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":740,"y":180,"wires":[["6e1c2f26.a12c48","ac7b176d.570d58"]]},{"id":"6e1c2f26.a12c48","type":"ui_text","z":"e5e03e58.27ca4","group":"bbfef042.d705a8","order":3,"width":0,"height":0,"name":"","label":"Result:","format":"{{msg.payload}}","layout":"row-left","x":900,"y":180,"wires":[]},{"id":"ac7b176d.570d58","type":"debug","z":"e5e03e58.27ca4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":910,"y":220,"wires":[]},{"id":"b0c78919.e89b2","type":"debug","z":"e5e03e58.27ca4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":590,"y":180,"wires":[]},{"id":"bbfef042.d705a8","type":"ui_group","name":"Product Registration Page","tab":"b7cd9db9.62a19","order":1,"disp":false,"width":"6","collapse":false},{"id":"b7cd9db9.62a19","type":"ui_tab","name":"Product Registration Page","icon":"dashboard","disabled":false,"hidden":false}]