From d77ca8aa3a5e902a576659fd16c2fa26438cc380 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 23 Jun 2021 23:23:28 +1000 Subject: [PATCH] Support URL fields --- InvenTree/templates/js/forms.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/InvenTree/templates/js/forms.js b/InvenTree/templates/js/forms.js index adfc9ad180..c9242fb925 100644 --- a/InvenTree/templates/js/forms.js +++ b/InvenTree/templates/js/forms.js @@ -303,7 +303,7 @@ function constructInput(name, parameters, options={}) { func = constructTextInput; break; case 'url': - // TODO - url input + func = constructTextInput; break; case 'email': // TODO - email input @@ -401,10 +401,24 @@ function constructCheckboxInput(name, parameters, options={}) { // Construct a "text" input function constructTextInput(name, parameters, options={}) { + var classes = ''; + var type = ''; + + switch (parameters.type) { + default: + classes = 'textinput textInput form-control'; + type = 'text'; + break; + case 'url': + classes = 'urlinput form-control'; + type = 'url'; + break; + } + return constructInputOptions( name, - 'textinput textInput form-control', - 'text', + classes, + type, parameters ); }