Integer validation for input textfields

Hi Team,

I need interger validation for input textfields.How to achieve this.

My Code

       var successMessageEntry = entryFactory.textField({
		    id: 'successMessage',
		    description: '',
		    label: 'Success Msg',
		    modelProperty: 'successMessage',
		    validate: function(element, values) {
		      var successMessageValue = values.successMessage;
		      
		      var validationResult = {};
		      var businessObject = getBusinessObject(element),
		       newObjectList = [];

		      var bo = getBusinessObject(element);
		      var assigned = bo.$model.ids.assigned(successMessageValue);

		      var idExists = !!assigned && assigned !== bo;
		      if (!successMessageValue || idExists) {
		        validationResult.id = "Element must have an unique id.";
		      }
		      
		     return validationResult;
		      
		     if (typeof values.successMessage !== 'undefined' && values.successMessage !== '') {
		 	     newObjectList.push(bpmnFactory.create('bpmn:SuccessMessage', {
		 	       text: values.successMessage
		 	     }));
		 	   }
		    }
	  		
		  });
	 group.entries.push(successMessageEntry);

Thanks
-Prameela

Make sure it matches the /\d+/ pattern?

Hi Nikku,

Thanks for reply.The pattern whatever you have mentioned above,how i can implement in my code.Is there any example code base for this.

Please let me know.

Thanks
-Prameela

Please get a detailed understanding of how the properties panel and JavaScript works. You’d need that if you want to work with bpmn-js anyway.

We will work on an example showing how to extend the properties panel. For the moment, please get familiar with it yourself.