Restrict copy, paste and special characters

 Restrict copy and paste for input widget  and also I need to restrict space and special characters in outsystems mobile, How can achieve this?

Hemamalini Vijayan wrote:

 Restrict copy and paste for input widget  and also I need to restrict space and special characters in outsystems mobile, How can achieve this?


You will find an OML in attach. You will see how it's done. (avoiding the right click paste funtion aswel)

Quick recap :

- Create an expression with escape content to 'no'. (drag it wherever you want)

- In the expression, you will have to write <script type="javascript"....

- In the script, call the document.ready function. 

- Reference your textbox runtime id. (this will be translated automaticly to the html id of the element)

- Disable the paste function


Originally Posted by : Niels Favreau


Thanks




assif_tiger wrote:

Hemamalini Vijayan wrote:

 Restrict copy and paste for input widget  and also I need to restrict space and special characters in outsystems mobile, How can achieve this?


You will find an OML in attach. You will see how it's done. (avoiding the right click paste funtion aswel)

Quick recap :

- Create an expression with escape content to 'no'. (drag it wherever you want)

- In the expression, you will have to write <script type="javascript"....

- In the script, call the document.ready function. 

- Reference your textbox runtime id. (this will be translated automaticly to the html id of the element)

- Disable the paste function


Originally Posted by : Niels Favreau


Thanks




How it can be achieved in mobile?


Hemamalini Vijayan wrote:

assif_tiger wrote:

Hemamalini Vijayan wrote:

 Restrict copy and paste for input widget  and also I need to restrict space and special characters in outsystems mobile, How can achieve this?


You will find an OML in attach. You will see how it's done. (avoiding the right click paste funtion aswel)

Quick recap :

- Create an expression with escape content to 'no'. (drag it wherever you want)

- In the expression, you will have to write <script type="javascript"....

- In the script, call the document.ready function. 

- Reference your textbox runtime id. (this will be translated automaticly to the html id of the element)

- Disable the paste function


Originally Posted by : Niels Favreau


Thanks




How it can be achieved in mobile?


Just refer the JS used with InputText & apply the same to Mobile.

JS :

$('yourtextboxRuntimeid').bind("cut copy paste",function(e) {
     e.preventDefault();
 });

Hemamalini Vijayan wrote:

assif_tiger wrote:

Hemamalini Vijayan wrote:

 Restrict copy and paste for input widget  and also I need to restrict space and special characters in outsystems mobile, How can achieve this?


You will find an OML in attach. You will see how it's done. (avoiding the right click paste funtion aswel)

Quick recap :

- Create an expression with escape content to 'no'. (drag it wherever you want)

- In the expression, you will have to write <script type="javascript"....

- In the script, call the document.ready function. 

- Reference your textbox runtime id. (this will be translated automaticly to the html id of the element)

- Disable the paste function


Originally Posted by : Niels Favreau


Thanks




How it can be achieved in mobile?


Hi assif_tiger.,

I have used this javascript on onintialise of that particular screen but it is not working. And also i want to restrict the special characters and space while typing itself. 


I too face the same issue. I have used the regex replace server action, but when i entered the values continuously regex replace does not work. How to restrict space and special characters while typing in mobile Application..

Can anybody help us?

Hi,

Refer the new solution for WEB:

Download the Forge Component for WEB & refer as below:

Component:

https://www.outsystems.com/forge/component/1002/restrictchars/?Unfollow=False


Sample:

https://www.outsystems.com/forge/component/3308/restrict-chars-sample/


Output Sample Demo :

https://joaomelont.outsystemscloud.com/RestrictCharsSample/


How To Use:

- Download Component & Add from dependencies n Project

- For Each TxtInput, Add a WebBlock of  respective Component

- Pass Input-ID 

- Set Restriction Type available in dropdown like : JustNumbers, JustAlpha etc

Cheers

Hi,

Refer below attached OML solution for Mobile :

JS I have used to validate:


var value = $parameters.Text;
$parameters.IsSpecial = /[~`!#$%\^&*+=\-\[\]\\';@,/{}|\\":<>\?]/g.test(value);
 

Do let me know, If you need some help.

Cheers

assif_tiger wrote:

Hi,

Refer below attached OML solution for Mobile :

JS I have used to validate:


var value = $parameters.Text;
$parameters.IsSpecial = /[~`!#$%\^&*+=\-\[\]\\';@,/{}|\\":<>\?]/g.test(value);
 

Do let me know, If you need some help.

Cheers

Hi assif_tiger,

Thankyou very much for your response. 

I refer your oml it was really helpful. But, the requirement is user should not able to type the special characters and space. 


assif_tiger wrote:

Hi,

Refer below attached OML solution for Mobile :

JS I have used to validate:


var value = $parameters.Text;
$parameters.IsSpecial = /[~`!#$%\^&*+=\-\[\]\\';@,/{}|\\":<>\?]/g.test(value);
 

Do let me know, If you need some help.

Cheers

Thank you for your reply,

The OML was really helpful, But it should restrict the user to type special characters and spaces.


How can I achieve this?


Regards,

Hemamalini Vijayan 

Hi Hemamalini Vijayan & Ellakkiya Selvadurai,

Refer the below new updated component published.

https://www.outsystems.com/forge/component-overview/5014/

An easy and light weight way to restrict characters in a input text field on mobile.

Options available:

  •    Just Numbers
  •    Just Letters
  •    Just Alpha and Numbers
  •    Email
  •    Currency
  •    Date
  •    Just Numbers and Hyphen
  •    Phone Numbers


Cheers

 

assif_tiger wrote:

Hi Hemamalini Vijayan & Ellakkiya Selvadurai,

Refer the below new updated component published.

https://www.outsystems.com/forge/component-overview/5014/

An easy and light weight way to restrict characters in a input text field on mobile.

Options available:

  •    Just Numbers
  •    Just Letters
  •    Just Alpha and Numbers
  •    Email
  •    Currency
  •    Date
  •    Just Numbers and Hyphen
  •    Phone Numbers


Cheers

 

Hi assif_tiger,

Thankyou for your reply

I have referred the module, but i have doubt in the datatype for the variable of the input field.

I have used the input field, variable which is allocated to the input field is of text datatype.By default text datatype is applied for the input field, it is not restricting the space and special characters.


 


Ellakkiya Selvadurai wrote:

assif_tiger wrote:

Hi Hemamalini Vijayan & Ellakkiya Selvadurai,

Refer the below new updated component published.

https://www.outsystems.com/forge/component-overview/5014/

An easy and light weight way to restrict characters in a input text field on mobile.

Options available:

  •    Just Numbers
  •    Just Letters
  •    Just Alpha and Numbers
  •    Email
  •    Currency
  •    Date
  •    Just Numbers and Hyphen
  •    Phone Numbers


Cheers

 

Hi assif_tiger,

Thankyou for your reply

I have referred the module, but i have doubt in the datatype for the variable of the input field.

I have used the input field, variable which is allocated to the input field is of text datatype.By default text datatype is applied for the input field, it is not restricting the space and special characters.


 


Hi,

You might be using the Initial Version, ,We had fixed some issues while testing.

Use the Stable Version : 1.0.3


Use this Option:

  - Just Alpha and Numbers [Without Space And Special Characters]

Cheers


assif_tiger wrote:

Ellakkiya Selvadurai wrote:

assif_tiger wrote:

Hi Hemamalini Vijayan & Ellakkiya Selvadurai,

Refer the below new updated component published.

https://www.outsystems.com/forge/component-overview/5014/

An easy and light weight way to restrict characters in a input text field on mobile.

Options available:

  •    Just Numbers
  •    Just Letters
  •    Just Alpha and Numbers
  •    Email
  •    Currency
  •    Date
  •    Just Numbers and Hyphen
  •    Phone Numbers


Cheers

 

Hi assif_tiger,

Thankyou for your reply

I have referred the module, but i have doubt in the datatype for the variable of the input field.

I have used the input field, variable which is allocated to the input field is of text datatype.By default text datatype is applied for the input field, it is not restricting the space and special characters.


 


Hi,

You might be using the Initial Version, ,We had fixed some issues while testing.

Use the Stable Version : 1.0.3


Use this Option:

  - Just Alpha and Numbers [Without Space And Special Characters]

Cheers


Hi assif_tiger,

I got little bit confused can you explain?


Solution

Ellakkiya Selvadurai wrote:

assif_tiger wrote:

Ellakkiya Selvadurai wrote:

assif_tiger wrote:

Hi Hemamalini Vijayan & Ellakkiya Selvadurai,

Refer the below new updated component published.

https://www.outsystems.com/forge/component-overview/5014/

An easy and light weight way to restrict characters in a input text field on mobile.

Options available:

  •    Just Numbers
  •    Just Letters
  •    Just Alpha and Numbers
  •    Email
  •    Currency
  •    Date
  •    Just Numbers and Hyphen
  •    Phone Numbers


Cheers

 

Hi assif_tiger,

Thankyou for your reply

I have referred the module, but i have doubt in the datatype for the variable of the input field.

I have used the input field, variable which is allocated to the input field is of text datatype.By default text datatype is applied for the input field, it is not restricting the space and special characters.


 


Hi,

You might be using the Initial Version, ,We had fixed some issues while testing.

Use the Stable Version : 1.0.3


Use this Option:

  - Just Alpha and Numbers [Without Space And Special Characters]

Cheers


Hi assif_tiger,

I got little bit confused can you explain?


Hi,

You can refer the sample for the same:

Restrict Characters Mobile Sample: https://www.outsystems.com/forge/component-overview/5016/

Cheers


Solution

Hi assif_tiger,

Thankyou for your response.


Ellakkiya Selvadurai wrote:

Hi assif_tiger,

Thankyou for your response.


Thanks Ellakkiya Selvadurai,

Have a Great Day :)

Cheers