Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By alisoroush7
#829250
hello guys
i have a textbox that is named Price. i want a javacode to not allow pepople entering anything except numbers in that field. for example if they enter a text, a pop up message appear and until they correct it , they can not submit the form.
User avatar
By kirkwg
#829251
Hi,
Why not dynaform > textbox > property > to set validate; no JS coding is needed.
Choose one option below to set the Validate:
    Only integers: ^\d+$
    Only positive or negative integers: ^[\-+]?\d+$
    Integers or decimal numbers: ^[\-+]?\d*\.?\d*$
    Number with up to two decimal digits: ^[\-+]?\d*(\.\d{0,2})?$
    Number with exactly two decimal digits: ^[\-+]?\d*\.\d{2}$
doc FYI: https://wiki.processmaker.com/3.0/Text_and_Textarea_Controls#Example_Regular_Expressions
By jarrett01
#831034
Java code to not allow people entering anything except numbers in a textbox named "Price":

Java
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
https://geometrydash-lite.com
public class NumberOnlyTextField extends JTextField {

public NumberOnlyTextField() {
addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
if (!Character.isDigit(e.getKeyChar()) && e.getKeyChar() != KeyEvent.VK_BACK_SPACE) {
e.consume();
JOptionPane.showMessageDialog(null, "Only numbers allowed!");
}
}
});
}
}
By evawillms
#831071
To set the validation for a textbox in ProcessMaker without using JavaScript coding, you can follow these steps:
1. Open the Dynaform designer.https://run3online.pro
2. Select the textbox control for which you want to set the validation.
3. In the properties panel on the left side, locate the "Validate" property.
4. Click on the property value field to open the dropdown menu.
5. From the dropdown menu, select one of the provided options to set the validation pattern.
If you want to set the textbox to allow only integers, you can select the option "Only integers: ^\d+$" from the dropdown menu.

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]