Text field - format mask

Hi!
How can I achieve that tex field will have formated mask like AB12 12345 123 123 1234 (first 2 signs are character - only AB, then there is 17 numbers with space), so when I write in that text filed numbers like 123451231231234 I get AB12 12345 123 123 1234? I don't know if I must use regular expression or something else.
I use apex 4.1
Regards,
drama9346

You can do this using javascript like in this example:
http://apex.oracle.com/pls/apex/f?p=31517:127
However, your requirement is more complicated and will need more coding.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
-------------------------------------------------------------------

Similar Messages

  • Number field - Format mask and validation

    APEX 4.2.1
    When a page item with source=DB column uses a Number type and a currency format mask (FML999G etc), when the page is rendered, it properly formats the number.
    The built-in Item is numeric validation appears to be handle this reasonably ok. i.e. both formatted values and only-digits both validate ok.
    But any after-submit validations choke on the non-numeric characters in the field! Please don't tell me I have to a) create shadow items and/or b) replace() out the non-numeric characters in the validation.
    After so many years and versions, why doesn't APEX have a simple, declarative, elegant solution to handle such a basic function?
    Am I missing something?
    Thanks

    As described in the item help
    "Select or enter a format mask. Note that format mask is applicable only to items of source type Database Column."
    In my experience, and this goes for the great web experience, not just the application you're designing - I've found the most data entry fields avoid formatting.
    Relevant information is often shown item labels.
    Any occasional the business has specifically asked for formatting, I've taken the same approach as I've needed to for years - before web development (and every time you use the to_date/to_char functions for date conversions) - validate the information as per expectation. If you think the user will be adding punctuation to a numeric field, then you must validate accordingly.
    This usually means adding TO_CHAR(value_entered, expected_format_mask) to your validation control, instead of presuming APEX will read the user's mind and know the content of that numeric field may not be numeric.
    Date entry does the same thing - ultimately there is a session date format that is implicitly used by Oracle to convert an entry of 12-10-2012 to the appropriate date -- ie, is it October or December?
    Have a think about the various websites you visit personally - plane bookings, concerts, ebay, etc - how many expect entry to be purely numeric? My recollection is most, except maybe some credit card fields, but most use some sort of regular expression to sort that out. And you can tell the validation is coded respectively.
    Generally, I reserve this sort of primping to reporting - even then it's made to be subtle - just like I'd prefer makeup to be ;-)
    Most users just care about the data, not how it looks.
    Scott
    blog: [url grassroots-oracle.com]grassroots-oracle.com
    twitter: [url twitter.com/swesley_perth]@swesley_perth
    -- please mark any useful posts as helpful or correct, in the end it helps us all

  • Character field format mask

    since Oracle Reports doesn't allow character data format masks, whats the work around to format telephone numbers, etc. without having to store them as a number data type?

    You can store the telephone number in the database as a varchar2(12) with the format. Say the user enters 3331114444 then while inserting the value change it to 333-111-4444 and store it. Else in the report convert your telephone number to a number field and format it.
    Select to_number(telephone_no) from table;

  • Formatted Text Field Formats

    I have a FormattedTextField where the user inputs a decimal value. It works just fine, until the user deselects the field. At this point, if the value is <1 with three leading zeros (i.e. 0.0001), the field displays 0. The correct value is obtained from the text field, and it displays just fine when it's being edited, but the output is inaccurate.
    // I print via String valueOf to make sure the issue isn't at a String function, and it turns out okay
    console.printConsole(String.valueOf(a3));
    // I specify a formatter factory with my own object (defined below)
    // Since I use the same formatter object for the display, input, edit params, I would
    // think the way it is outputted wouldn't change across these, but it does
    label3 = new JLabel("i power " + 3 + " coefficient");
    field3 = new JFormattedTextField(new DefaultFormatterFactory(
    new CalFormatter(),
    new CalFormatter(),
    new CalFormatter()));
    // And I make sure there are enough columns to display the info
    field3.setValue(new Double(a3));
    field3.setColumns(10);
    // My cal formatter object
    class CalFormatter extends NumberFormatter{
    public CalFormatter(){
    super();
    // I manually call the valueOf String function in case that's where the loss of accuracy originates
    // ...no luck
    public String valueToString(double number) throws ParseException {
    return String.valueOf(number);

    what happens when you switch the lines to do the following:
    from this:
    field3.setValue(new Double(a3));
    field3.setColumns(10);
    to this:
    field3.setColumns(10);
    field3.setValue(new Double(a3));
    setColumns clears the field, so that may be your problem.

  • Date format Mask for CHAR datatype

    hi
    i want to assign a format mask like 'dd/mm/yyyy' to a field which has char datatype can i ?

    The quickest answer to your question is to try it! :-) If you click on the Format Mask property of your Text Item and then press F1 Forms will display the Format Mask Help information for this property. All of the valid combinations for a Text Field Format Mask will be displayed.
    To answer your question, you can put a format mask on a Text Item that can enforce the basic format of 'DD/MM/YYYY', but you could get data like: 99/99/9999. You would have to write code in a When-Validate-Item trigger that would ensure the user has entered a valid date.
    Hope this helps.
    Craig...

  • How Can I Change Format Mask For All Fields that type's Number Depend on Parameter in Report Builder 10g ?

    I want Change format mask for all fields that type's number
    Such as
    if  :parameter_value = 1 then
       all fields format mask = ' 999,999,990.000' ;
    else
       all fields format mask = ' 999,999,990.00' ;
    end if;
    Regards

    So, i have bad news for you : you'll have to rebuild again.
    Meanwhile i have excellent news for you : there's an online tool made by Johannes Henseler called Sidecar xml which builds the necessary xml file for you, sort of what you find in the Digital Publishing Folio Editor website, but saves it in your Folio folder.
    Next time you import all your folder (with that file), it will place all the necessary information, and even reorder the articles.
    Build once, play many times.

  • How to Show Partial SSN in a Text Field

    Hi,
    I have text field on an apex page which takes SSN as input.
    How to show only last four digits of SSN after it has been entered.
    For Instance when I type 111-222-3333 and hit enter or tab, it should appear as XXX-XXX-3333.
    Thanks in Advance.
    Yogi

    Hi Yogi,
    You did not mention the most important thing.. Where are going to display the SSN ..
    if it is in report then:
    select regexp_replace ('111-222-3333','[0-9]{3}-[0-9]{3}','XXX-XXX') from dualOutput:
    SSN
    XXX-XXX-3333
    If you are going to show it on an item, then you should use that REGEXP in the source of your item... The source could be SQL or PL/SQL.
    If you need to show this format XXX-XXX-3333 as the values is being entered, the this plugin could be helpful:
    http://apex-plugin.com/oracle-apex-plugins/item-plugin/text-field-with-masked-input_63.html
    Best Regards,
    Fateh
    If you believe that my answer was correct or helpful, then please mark the answer as helpful or correct

  • Auto populate blank text fields with n.a from a button or on print out.

    This seems straight forward but I cannot find an existing questions on this topic.
    I would like to add a form function that will fill any blank text fields with n.a. I do not want to use the default field value as I think it will cause confusion and cannot be applied for text fields formatted for dates. Is it possible to run a script that can do this? It would be OK if the action was triggered from a button or print activity after the rest of the form has been completed.
    Any thoughts would be appreciated.
    Thanks

    The question is whether your form is used only for filling out on screen (and not as a level 0 form, being printed out and filled out manually).
    If so, why not make the default value of the concerned fields to be "n/a" (or whatever you want to name them). That would relieve you from any validating before printing.
    Otherwise, you could maintain a list of field names which should get the n/a value if empty. This list would be an array.
    Your code in the willPrint event (if you want to have it reliably) would then look like this:
    for (var i = 0 ; i < nafieldarray.length ; i++) {
    if (this.getField(nafieldarray[i]).value == this.getField(nafieldarray[i]).defaultValue) {
    this.getField(nafieldarray[i].value = "n/a") ;
    HTH.
    Max Wyss.

  • Date Format Mask with text only...

    Hi!
    I have a problem with my date text item: the format mask is set to YYYY-MM-DD HH24:MI:SS and it work perfectly if the user enter only numeric character, it will validate the date correctly. But if the user enter a value only alpha (something like 'uuuuyyyy') instead of validate with the mask format it will fire an error trigger ORA-06502.
    I want to know if it's possible to check if the user has enter only alpha to bypass this problem.
    Also, how can a check that a date field is null. I Try with : IF :BLOCK_NAME.DATE_ITEM IS NULL THEN ...
    AND ALSO with IF TO_CHAR(:BLOCK_NAME.DATE_ITEM) IS NULL THEN... and nothings seems to work.
    Thanx in advance.

    AFAIK, the only way to do this is to have two items. One is a hidden database item, type DATETIME, to hold the date value.
    The other is a non-database character item, visible to the user. You populate it at POST-QUERY from the database field, and use an ON-VALIDATE-ITEM to copy any value entered/changed by the user over to the hidden field. If you're smart, you'll write a library procedure to do the on-validate stuff, passing it the names of the two items.
    In that procedure, you can attempt to convert the entered text into a valid date using whatever date format(s) you like, only raising an error if you can't do it at all.

  • Need Format masks which can be added to oracle form fields

    Hi All,
    I needed a list of all the format masks present for Oracle Forms fields. The problrm that i face currently that when I apply masking (999g999g999d99) the values in the text item field on the form side are no more left justified but shift towards the center of the field. PLease help me out.
    Thanks,
    Gaurav

    Hi Gaurav,
    You are on the wrong forum. Post your question on the Forms forum.
    Regards,
    Andrei

  • Formatted Text Field

    I have a text field that I want the user to be able to enter up to 4 numbers. I tried a mask formatter using the "####" format, but that forces the user to enter 4 numbers. I want them to be able to enter, 1,2,3 or 4 numbers.

    Hi,
    I've implemented number fields based on JFormattedTextField.
    They also support a min and a max value.
    Maybe you find them useful (the library is open source):
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JRealNumberField.html
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JDoubleField.html
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JFloatField.html
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JLocalizedRealNumberField.html
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JLocalizedDoubleField.html
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JLocalizedFloatField.html
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JWholeNumberField.html
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JByteField.html
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JIntegerField.html
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JLongField.html
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JShortField.html
    Tutorial:
    http://softsmithy.sourceforge.net/lib/docs/tutorial/swing/number/index.html
    Homepage:
    http://www.softsmithy.org
    Download:
    http://sourceforge.net/project/showfiles.php?group_id=64833
    Source:
    http://sourceforge.net/svn/?group_id=64833
    http://softsmithy.svn.sourceforge.net/viewvc/softsmithy/trunk/lib/src/org/softsmithy/lib/
    -Puce

  • How to provide text formatting options to user from a text field

    Hi,
    My requirement is - in the interactive form, a comments field needs to be provided where user should be able to enter text with formatting options like
    Headers
    indentations
    bold/italic
    bullet points and numbers
    Once user enters the formatted texts in a text field, data needs to be displayed/printed in the same format. Could you help me on how to provide these formatting options to the user for a particular text field?
    I understand that once I define the text field with format XHTML (with RTF), user formatting can be captured and displayed in the same way. But I am not sure on how to provide the formatting options for the text field.
    Thank you,
    Madhu

    Hi,
    if you select a text field for Rich Text and the press Ctrl + E you'll get a bar for all available text formatting options in Acrobat/Reader.

  • How to create a group/list of check box variables for display in text field, in appended format

    I need to identify a series of single-response checkbox variables and display the ones selected (as a group) in a text field in an appended (comma, space) format. Last week, you provided a great little script for a similar need using List Box (multiple response) variables. This time I need to know how to formally identify the checkbox variables and, I presume, use a similar script to display the results in a comma, space format.
    You've been of great help.
    Thanks

    Here's the script adapted to this situation. It assumes there are ten check boxes named cb1, cb1, cb2, ...cb10.
    // Custom Calculate script for text field
    (function () {
        // Initialize the string
        var v, s = "";
        // Loop through the check boxes to build up a string
        for (var i = 1; i < 11; i++) {
            // Get the value of the current check box
            v = getField("cb" + i).value;
            if (v !== "Off") {
                if (s) s += ", ";  // Add a comma and a space if needed
                s += v;  // Add the selected value
        // Set this field value to the string
        event.value = s;
    You'll have to change the field name and starting/ending numbers to match your form.

  • Formatting of text fields when exporting from InDesign to Acrobat Pro

    How does one preserve the formatting  of a text field when exporting from InDesign CS6 to Acrobat Pro? It loses both the font and the alignment formatting in the PDF.

    Use a font that allows embedding/ check the font embedding settings in the PDF output settings.
    Mylenium

  • How to copy paste a table structure from word document into Text Field [field format Rich Text]

    In our current implementation we have a Blank page with Text Field [field format Rich Text] on generated PDF Document.
    Once the PDF document is generated, user can copy paste content form any word/rtf document to into the Text Field.
    Pasted content retains all text formatting [Bold, Italic, Underline, Indentation] except the Table format. Text Field is removing table metadata from the content and converting it into plant text.
    Is there anyway to copy paste table structure as it is from word document into Text Field?

    Hi,
    I don't think you can! While you can paste formatted text into the rich text field, the table metadata means nothing to the textfield.
    Niall

Maybe you are looking for

  • Syncing on a new computer

    When I switched to this computer I declined to sync it with the library to keep my music but I believe to only option is to do that now but When I said no i clicked dont ever show that again and no other sync option will allow me to erase the music t

  • Getting time expired error in labview while getting screen capture

    Hello, I have to capture a screen shot for Agilent's Spectrum analyzer, ESA series. But Whenever i run the program i always get time expired before operation is completed. I am attaching the program and also screen-shot of program. If anyone can solv

  • Enterprise Services & Managing Quality of Service

    Hello, the documents published recently regarding ESA are pretty much aligned with the general idea to follow the idea of SOA. We talk a lot about enterprise level functionality and the reuse of high-level patterns being developed. However there is n

  • Strange Import Problem

    I'm running JES Q42005, the whole messaging stack. When I import an ICS file using both csimport, and the webmail (via UWC and directly to CS) interface, the time isn't coming over properly. As a control, I used two identical calendar entries that we

  • Script to install and enable file and printer sharing windows 7

    Hello I posted this question on the Microsoft Partner Windows 7 forum and the support person told me that I should post it here. I have a Customer that was running Novell.  We will migrate them to Active Directory. The question I have is.  they did r