How to restrict a text field to accept limited number of digits (only) with leading zeroes
I am trying to restrict a field for accepting only limited number of digits that can have zeroes in the begining - this why I can't use Numeric field. Can anybody help?
Hi Niall,
Thank you very much,
I did something like what you told me - thought I used script in ordetr to prevent entering any chracters except digits.
In Change event I enterd the following script:
// Restrict input to digits only - Number of digits (characters) assigned in Object Palette - Field Tab
if((xfa.event.change != 1) && (xfa.event.change != 2) && (xfa.event.change != "3") && (xfa.event.change != "4") && (xfa.event.change != "5") && (xfa.event.change != "6") && (xfa.event.change != "7") && (xfa.event.change != "8") && (xfa.event.change != "9") && (xfa.event.change != "0"))xfa.event.change
= "";
This does the job.
Thank you,
Peter.
Similar Messages
-
How to allow input text field to accept more than one "specific" answer.
Hi,
I am working for something and trying to create a type-box-based quiz for one of my classes, where an input text field can change it's border color if 2 or more words from an accepted word list is inputed.
For example, Say a list has possible answers: R,G, B, Y for the question "Name 2 colors".
I want to create an input text box where the border of the box will change color if any 2 letters (in the above list) are entered into it.
I've tried setting up a variable NumberSuccesses and setting it so that the number increases by 1 for each letter entered e.g.
if (Ex.text == "R");
NumSuc = NumSuc +1; // the var NumSuc has already been defined earlier in the code
If (Ex.text ''G")
NumSuc = NumSuc + 1
if (NumSuc == 2)
Ex.borderColor = 0x0000FF
but that didn't work.. and I tried doing it with another function which I use for multiple input boxes like if there were boxes A, B, C. I could set up a general function where if the correct answers were entered into A, B, an C respectively, only then will say, a checkmark show up using a
EnableCheckmark (); type function. Not sure how to do it if it's the same text input box though. Also just tried adding it into the same function re.
If (Ex.text == "R" + "G")
Ex.borderColor = 0x0000FF
.. Does anyone know what else I can do?The solution of Nishu with Evaluation Logic:
//These Are the Possible Answers
var solutions:Array = new Array("A","B","C","D");
function testInput(_inputText:String):Boolean
//the delimiter could also be a comma, here it is a space
var inputStringArray:Array = _inputText.split(" ");
var counter:Number = 0;
for (var i:int=0; i<inputStringArray.length; i++)
for (var j:int=0; j<solutions.length; j++)
if (inputStringArray[i]== solutions[j])
counter++;
if (counter >=2)
trace("true");
return true;
else
trace("false");
return false;
//Textfield with name input_txt on stage
input_txt.addEventListener(TextEvent.TEXT_INPUT, answerTxtInp);
// The function that will be called by the event listener
function answerTxtInp(txtEvent:TextEvent):void
// depending on the possible answers of characters, change the border color
if(testInput(input_txt.text)){
input_txt.borderColor = 0xFF0000;
else{
input_txt.borderColor = 0x000000; -
How to restrict the text field to enter only numbers???
I have used "onkeyup" event to call a function "test", I am getting the alert message for every entry (even for a number), I dont know why I am getting this. Please help me out.....
Number1 : <input type="text" name="myin1" id="a" onkeyup="test(this,event)">
function test(ff,evt)
evt = (evt) ? evt : event;
var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode :
((evt.which) ? evt.which : 0));
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
alert("Only numbers are allowed"); }
}Hi,
However this is java forum and you are asking for a solution of a javascript problem,
I think I got the problem.
This script works fine when I run it on IE and use the numeric keys above the text keys,
but give error when I use the numerical keypad on the right.
I think you should change your if condition like this
if (charCode > 31 && ((charCode < 48 || charCode > 57) || (charCode < 96 || charCode > 105)) { -
How to validate an text field item using javascript for numbers only.
hi,
how to validate an text field item using javascript for numbers only.please help me on this urgent
please mail me solun if posible on [email protected]Hi,
Page HTML header
<script>
function onlyNum(evt) {
// Usage: onKeyPress="return onlyNum(event)"
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
var status = 'This field accepts numbers only!';
alert(status);
return false;
var status = '';
return true;
</script>Item HTML Form Element Attributes
onKeyPress="return onlyNum(event)"Br,Jari -
How to add new text field in standard report
how to add new text field in standard report?
Hi,
I presume you are talking about a report display in ALV and u wish to add a column to it .
If it is a global requirement ,as in table being used there in ALV can be modified, then you can append the table and the system should pick up the same automatically from there.
Otherwise , you can make a Z program . Modify the catalog being used in ALV.
Regards,
Shweta -
How to restrict header text changes in sales order level
Dear Experts,
how to restrict header text changes in sales order level change mode
thanksHello Chandu,
how to restrict header text changes in sales order level change mode
In order to restrict changes to Sales Order Header Text, the appropriate User Exit would be USEREXIT_MOVE_FIELD_TO_TVCOM_H. With the help of ABAPer, you can include the simple logic on the basis of Header Text type such that whenever any changes are incurred on the Sales Order header text, updates would be prevented.
Please try out this approach and let us know your latest observation on this issue.
Regards,
Sarthak -
How to populate the TEXT field in MIGO
Hi folks,
While creating material document in MIGO or MB01, i am inserting some data in TEXT ( Field in line item level ). This text data is disappearing , once mat doc is created.
how to populate the TEXT field in MIGO?Is there any cusomisation?it's urgent .
Regards
pabiHello Pabitra,
I had a similar issue in my Project.
Please verify if the SMOD enhancement MBCF0002 (EXIT_SAPMM07M_001) is active in your system.
If this is the case, verify from two angles:
a) Whether the Enhancement was accidentally activated - If yes, then De-activate the same
b) If there is some logic coded in the User Exit, but, the Text is somehow not determined...even the existing content in the text field (input to EXIT_SAPMM07M_001) will get vanished.
Hope that your problem will be resolved by this. Pls reward points.
With Regards
Vijay Gajavalli -
How to collapse unused text field in PDF form
Hi all, may i know how to collapse unused text field in a PDF form. Etc, we have alot of description line for user to enter the info, but some line will be left unused, so i was wondering whether can i hide those unused text field. But when i need them, i just expand it and use it.
I don't think w/o UI Customization it is possible.
UI customization won't be a small one as it is a common wizard and used at multiple places. So it will be a huge work. -
How to rotate a Text Field?
Is there anyone who knows how to rotate a Text Field? I just need to move some degrees (for example: clockwise).
Thanks in advance for any help you can provideYou can onlt rotate it in 90 degree imcrements ...this is controlled on the
layout tab next to the anchor setting.
Paul -
TS2755 How do i stop text messages from going to my ipad I only want them to go to my iphone
How do I stop text messages from going to my ipad I only want them going to my iphone
Using FaceTime http://support.apple.com/kb/ht4319
Troubleshooting FaceTime http://support.apple.com/kb/TS3367
The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
http://tinyurl.com/a7odey8
Troubleshooting FaceTime and iMessage activation
http://support.apple.com/kb/TS4268
iOS: FaceTime is 'Unable to verify email because it is in use'
http://support.apple.com/kb/TS3510
Using FaceTime and iMessage behind a firewall
http://support.apple.com/kb/HT4245
iOS: About Messages
http://support.apple.com/kb/HT3529
Set up iMessage
http://www.apple.com/ca/ios/messages/
iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage
http://support.apple.com/kb/HT5538
How to Set Up & Use iMessage on iPhone, iPad, & iPod touch with iOS
http://osxdaily.com/2011/10/18/set-up-imessage-on-iphone-ipad-ipod-touch-with-io s-5/
Extra FaceTime IDs
http://tinyurl.com/k683gr4
Troubleshooting Messages
http://support.apple.com/kb/TS2755
Troubleshooting iMessage Issues: Some Useful Tips You Should Try
http://www.igeeksblog.com/troubleshooting-imessage-issues/
Setting Up Multiple iOS Devices for iMessage and Facetime
http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
FaceTime and iMessage not accepting Apple ID password
http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
Fix Can’t Sign Into FaceTime or iMessage iOS 7
http://ipadtutr.com/fix-login-facetime-imessage-ios-7/
FaceTime, Game Center, Messages: Troubleshooting sign in issues
http://support.apple.com/kb/TS3970
Unable to use FaceTime and iMessage with my apple ID
https://discussions.apple.com/thread/4649373?tstart=90
How to Block Someone on FaceTime
http://www.ehow.com/how_10033185_block-someone-facetime.html
My Facetime Doesn't Ring
https://discussions.apple.com/message/19087457
Send an iMessage as a Text Message Instead with a Quick Tap & Hold
http://osxdaily.com/2012/11/18/send-imessage-as-text-message/
To send messages to non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
How to Send SMS from iPad
http://www.iskysoft.com/apple-ipad/send-sms-from-ipad.html
You can check the status of the FaceTime/iMessage servers at this link.
http://www.apple.com/support/systemstatus/
Cheers, Tom -
How can I format a number with leading zeros?
I need to convert an int to occupy exactly 3 positions in a StringBuffer... I need the space in the StringBuffer to be filled with leading zeros where appropriate. Can anyone show me how to do this correctly please ?
At the moment I am using a pretty dumb workaround to fill the target with "000" first and then parse the int into either 1 2 or 3 positions depending on its value ... it works, but there must be a more correct way to do this ...
Thanks in advance ...Have you had a look at the class java.text.DecimalFormat? It does exactly what you want... example:
StringBuffer sb = new StringBuffer();
DecimalFormat format = new DecimalFormat("000");
format.format(2, sb, new FieldPosition(0));
System.out.println(sb);
prints out the string 002. -
** Please help urgently ** Budget upload field with leading zeros
We need to load a characteristic that has leading zeros. For example 0000350. When saving down to CSV, we lose the leading zeros (0000) so that only 350 is loaded into BW. Saving the codes as 'text' in excel does not seem to help.
We cannot therefore see the name for any of these codes when refreshing the workbook in BW.
Could some please urgently tell us the correct method to save the file for loading into the BW infopackage, with all zeros intact ?
Regards, FrederickHi Frederick,
Just some additional thoughts,
assuming field A1 in Ecel contains 350 and you want to create a string with 8 digits, you could use formula '=text(A1;"00000000")' in an empty column and copy it back to column A. Then 00000350 should be provided in A1. This can be saved in a normal .csv file and be opened with a text editor (e.g. notepad) in order to check content.
If you don't want to manipulate Excel data, transformation to a field with leading zeros can be easily be processed with a routine in transfer rules.
Regards
Joe -
Need formula to take text from one cell, add that to a serial number with leading zeros
I'm trying to create a spreasdheet cell that simplifies creating videotape Numbers from a job name in cell and appends a serial number with leading zeros, and that would survive an export to EXCEL.
The result would look like
A Column
Job Name
B ColumnTape #
Formula needed for B
ClientName-TapeType-
ClientName-TapeType-001
=
ClientName-TapeType-
ClientName-TapeType-002
=
I've tried using a custom cell format that had the text in front of the (Integer) drag and drop, with three integers and leading zeros.
That worked, but requires recreating the custom cell format for each client and tape type.
So, I've used the formula =A2& in order to play around with different things, but haven't hit on something that adjusts for increased numbers and retains the leading zeros.
I don't mind doing a starter for the first row and then adding +1 in the formulas for the rows below.
I've done that using the custom cell formats for the first B cell and then using =Bx+1 in the following cells. It works, but I'm hoping to find something simpler or that can be copied and pasted in multiple rows on one paste.
Thanks in advance.
Suggestions much appreciated!
TedTed,
This expression in B will give you the pattern I believe you are looking for:
=A&RIGHT("00"&ROW()-1, 3)
Here's a screen shot...
Jerry -
How I can set up the DynDns inside the Time capsule, or only with the Time capsule I have external access from a PC for ex.?
MobileMe service is finished.. to get remote access to the Mac or TC you use iCloud account.. but that is for files.. not to access web cams.
Without dyndns client in the TC, you can perhaps run dyndns on the computer or video recorder..many of these will have clients built into them.
Even better get a static Public IP from your ISP.. that is the correct professional way to do it.
Or you can use whatever broadband modem you have and remove the TC as the main router.. simply bridge it. Use your adsl router for connection. Almost all adsl have built in dyndns.
Sorry your language is very hard to follow.. and I am sure you are finding my answers similarly difficult.
Basically the TC is about the hardest device to setup because it is lacking important networking functions.
Get a vpn router and use vpn connection is far superior to any other method. But you cannot do it with TC. -
I've purchased two numbers Skype How do I know an incoming call to any number of digits?
I've purchased two numbers Skype How do I know an incoming call to any number of digits?
You can get the past 18 months' worth of call logs via your MyVerizon account by viewing past bills. For those older than 18 months, you'd need to talk to Customer Service; I believe they charge $5 per bill to send them to you.
Customer Service:
Dial *611 from a cell phone
(800) 922-0204
Monday - Sunday 6 am - 11 pm
Maybe you are looking for
-
Why can't I print a secured web page (https)? Win7, FireFox 5.0
Whenever I try to print a secured web page using FireFox 5.0 nothing happens. I have to switch to Internet Explorer 9.0 to get the printed secured web page. I'm using win 7 Pro 32-bit on a desktop machine
-
How do I find out the name of an area menu?
I can see a report with a specific t-code in an area menu, how can i find out the name of the area menu, when i need to edit it in se43?
-
Itunes won't start, error 7, windows error 126.
After updating my itunes a few weeks ago, it now won't load and I get the following error message; the program can't start because avfoundationcf.dll is missing from your computer. try reinstalling the program to fix this. followed by this error mess
-
Can anyone give me the steps for moving the repository databases in 9.3.0?
We are in the 9.3.0 environment and I need to move the four repository databases for essbase, biplus and webanalysis/workspace to a new machine. I tested moving the databases and rerunning the config util, but I lost my sample reports I created earli
-
My iPhone 5C has crashed when reset it turns red or sends a message on top and sometimes even looks like a race track running through the screen