devper
September 6, 2019, 9:32am
1
Hai , I’m using the API Connector but i have obstacles, how to make an email form to lowercase. If it’s not lowercase then it can’t submit.
this my backend result, if not forced to use lowercase, chaos will occur.
this my validation rules.
I want, if the user entered an email like this can not be sent.
Thanks for your help
Hi @devper
You need to add a convert on your variable on the server action.
Form
Result
Server Action
Hope this helps.
3 Likes
devper
September 6, 2019, 1:58pm
3
thanks @raymantle for your respone. is it possible without using server side?
because I only use the parse platform for my backend.
So, I’m no expert, but the other way you can do it is like this.(P.S. one of the pros may have the correct approach)
Create a hidden input.
Then set the value of the hidden input to copy the user’s entered value and convert to lower case.
Go to Dynamic Attributes of the hidden input.
Select Value
Set the value on the input to the value of the original input
Then preform your formatting
Then you would pass the hidden input to your backend.
There maybe a better and more correct way, but this is how I would do it.
Ray.
sid
September 6, 2019, 6:22pm
5
You can set a regex condition in validation rules for the input box. I don’t know the exact regex, but you can easily find one which allows only lowercase text.
Also, you can try using a hidden field which can be set on ‘oninput’ event of actual textbox with the value in lowercase.
That way, when you submit the form, value of hidden field will get submitted instead of the textbox.
devper
September 7, 2019, 2:30am
6
Thanks @raymantle its work.
@sid i don’t know how to use regex. can you explain how? Thanks
sid
September 7, 2019, 2:35am
7
There should be a pattern rule in validation rules for the input. Try setting up regex pattern in that.
Refer this for a lowercase only pattern: https://stackoverflow.com/questions/14107331/regular-expression-to-only-allow-lower-case-letters
You will have to modify it to allow @ dot and underscore.
Try using https://regexr.com for understanding and building regex patterns.
1 Like
Hello @devper .
Simply make dynamic event > onkeyup > format the particular input value to lowercase.
1 Like