This topic is locked
[SOLVED]

 Online refreshing

9/12/2011 12:47:37 PM
PHPRunner General questions
C
CK. author

Hi,
In Visual Editor, there is an option named 'Regular Expression', we can set the expression we require eg. ^[A-Z0-9]+
What if I set the Regular Expression to ^[A-Z0-9]+, I want the field only allow the expression given + automatic refresh the lowercase value I enter to uppercase? (eg, thomos become THOMOS) or if I set the expression to currency with 2 decimal, system only allow me to enter [0-9.-]
CK

Sergey Kornilov admin 9/12/2011

Regular expressions are for validation purposes only. You cannot use validation to change the case. You can though use Javascript API to assign CSS property text-transform:

http://www.w3schools.com/cssref/pr_text_text-transform.asp
Use addStyle function for this purpose:

http://xlinesoft.com/phprunner/docs/ctrl_addstyle.htm

var ctrl = Runner.getControl(pageid, 'Make');

ctrl.addStyle('text-transform:lowercase');
C
CK. author 9/12/2011



Regular expressions are for validation purposes only. You cannot use validation to change the case. You can though use Javascript API to assign CSS property text-transform:

http://www.w3schools.com/cssref/pr_text_text-transform.asp
Use addStyle function for this purpose:

http://xlinesoft.com/phprunner/docs/ctrl_addstyle.htm

var ctrl = Runner.getControl(pageid, 'Make');

ctrl.addStyle('text-transform:lowercase');



Thanks for your rapid reply.
As per mention above, what if

  1. I prefer only digits, and auto truncate non-digit input
  2. I prefer only A-Z (uppercase), so whatever non- A to Z character user type will not shown.
    Regards,

    CK

Sergey Kornilov admin 9/12/2011
C
CK. author 9/12/2011



I see what you saying.
Check masked input in this regard:

http://xlinesoft.com/blog/2011/04/30/masked-input-in-phprunnerasprunnerpro-applications/


Cause I'll like to make it the standard for all my application, is they a way to add > <script type=text/javascript src="include/jquery.maskedinput-1.3.js">

into a template to make it load every time the form created in state of doing it manually for each form?
CK

Sergey Kornilov admin 9/13/2011