Validate a rescource form field

hi,
what is the best way to validate a resource form field in oim11gr2?
in my case I would like to verify, that the oracle dbum "user login" field is written in capitals.
thank you!
br

Hi,
You cannot access the DB from the script. If you want to access the values of a field you should use session variables. Here is a sample to access the values of a form field.
declare
ticket_no varchar2(20);
flight_no varchar2(20);
blk varchar2(30) := 'DEFAULT';
begin
ticket_no := p_session.get_value_as_varchar2(
p_block_name => blk,
p_attribute_name => 'A_TICKET_NO');
flight_no := p_session.get_value_as_varchar2(
p_block_name => blk,
p_attribute_name => 'A_FLIGHT_NO');
end;
Thanks,
Sharmila

Similar Messages

  • Validate Dynamically Generated Form Fields

    Hello, I am having difficulty in validating some text boxes I dynamically generated using javascript.
    I have done the below which is not working..... giving errors of undefined or is null
    var i=rowNum;//value of the integer giving the form field a unique name
    var thefield =(eval(document.getElementById('xxxx_'+i).value));
    if (thefield =="")
    alert("xxxxxxxxxxxxx");
    This is not working. Any one has example of validating dynamically generated form fields?

    Check out jquery and the validation plug-in by Jörn Zaefferer: http://plugins.jquery.com/project/validate
    It'll simplify your life!

  • How to Validate a Portal Form field from the database

    I created a Portal Form based on a procedure, which requires three parameters. One of the parameters is Item Number. I need to check if the Item Number exists in database. I am trying to use pl/sql button event handler, where I try to use the select count(*) statement to verify. However, I don't know how to reference the form field in the where clause. Please advise. Or is it possible to achieve this by creating a javascript? If you go to 'Shared Component' provider and click on javascript, you will see some system validation scripts, which you can call in the form level validation. My doubts with javascipt is how I can talk to database in the script? Any input is appreciated.

    Hi,
    You cannot access the DB from the script. If you want to access the values of a field you should use session variables. Here is a sample to access the values of a form field.
    declare
    ticket_no varchar2(20);
    flight_no varchar2(20);
    blk varchar2(30) := 'DEFAULT';
    begin
    ticket_no := p_session.get_value_as_varchar2(
    p_block_name => blk,
    p_attribute_name => 'A_TICKET_NO');
    flight_no := p_session.get_value_as_varchar2(
    p_block_name => blk,
    p_attribute_name => 'A_FLIGHT_NO');
    end;
    Thanks,
    Sharmila

  • How do I make a form field validate that it is the sum of two other fields?

    Hi there,
    I am creating a form, and I would like one of the fields to validate by making sure that this field is the sum of two other fields in the form.  Does anyone have any ideas on how to go about this?  I know I'll need to run a custom validation script, but I'm not sure where to begin - I've never done one for validation before.
    Thanks for any help!

    OK, here's a sample script that I hope will clearly demonstrate the general approach. It is intended to be the custom Validate script of the field that the user enters that value that is supposed to be equal to the sum of the two others.
    // Custom Validate script
    (function () {
        // Get the value that the user entered
        var sVal = event.value;
        // If it is blank, do nothing else
        if (!sVal) {
            return;
        // Convert string to a number
        nVal = +sVal;
        // Get the values of the fields, as numbers
        var v1 = +getField("text1").value;
        var v2 = +getField("text2").value;
        // Add them together, rounding to two decimal places, converting to number
        var sum = +util.printf("%.2f", v1 + v2);
        // Compare entered value to the sum of the other two fields
        // Alter the user if they do not match
        if (nVal !== sum) {
            app.alert("The value you entered does not equal the sum of text1 and text2. Please correct.", 3);
            // If you want the entered value rejected, include the following
            event.rc = false;
    Replace "text1" and "text2" with the actual field names.

  • In Adobe Acrobat XI Pro, how do I validate a form field so that it's numerical value is less than or

    I have one numerical field named "B," and I need to validate it so that it is less than or equal to the value of another field named "A." I can't figure out how to do that!

    OK, so the custom calculate script for field B could be something like:
    (function () {
        // Get field values as strings
        var sA = getField("A").valueAsString;
        var sC = getField("C").valueAsString;
        var sD = getField("D").valueAsString;
        // Only perform the calculation if all fields are filled
        if (sA && sC && sD) {
            var sum = +sC + sD;
            event.value = sum;
            // Alert the user if the sum is more than A
            if (sum > +sA) {
                app.alert("Error message goes here");
        } else {
            // Blank this field if all fields are not filled in
            event.value = "";
    Instead of (or in addition to) an app.alert popup, you could place this message in a read-only form field, and clear it if there is no error condition.

  • Validate form field for CE 7.1 SP3

    Hi Experts
    I want to validate the form field and I follow the example of the SimpleError Form sample:
    public void checkMandatory(java.lang.String fieldName) {
    //@@begin checkMandatory()
    IWDMessageManager messageMgr =
    wdComponentAPI.getMessageManager();
    Object attributeValue =
    wdContext.currentContextElement().getAttributeValue(fieldName);
    IWDAttributeInfo attributeInfo =
    wdContext.getNodeInfo().getAttribute(fieldName);
    if (attributeValue instanceof String) {
    if (((String) attributeValue).length() == 0) {
    String fieldLabel =
    wdContext.getNodeInfo().getAttribute(fieldName)
    .getSimpleType().getFieldLabel();
    messageMgr.reportContextAttributeMessage(
    wdContext.currentContextElement(),
    attributeInfo,
    IMessageSimpleErrors.MISSING_INPUT,
    new Object[] { fieldLabel },
    true);
    //@@end
    public void onActionSave(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
    //@@begin onActionSave(ServerEvent)
    this.checkMandatory(IPrivateForm.IContextElement.NAME);
    this.checkDateInPast(IPrivateForm.IContextElement.BIRTHDAY);
    this.checkDesired(IPrivateForm.IContextElement.E_MAIL_ADDRESS);
    wdComponentAPI.getMessageManager().raisePendingException();
    wdComponentAPI.getMessageManager().reportSuccess(
    "The sample form data was successfully saved!");
    However, I realise that some of the methods used in the sample  are already depreciated. Methods such as reportContextAttributeMessage and raisePendingException();
    I am currently using CE7.1 SP3
    Can advise ?
    Thank you.

    Hi,
    Following methods are not depricated.
    reportContextAttributeMessage(IWDAttributePointer[] attributes,  IWDMessage message, Object[] args)
    reportContextAttributeMessage(IWDAttributePointer attribute,
              IWDMessage message, Object[] args)
    Regards
    Ayyapparaj

  • A form field to insert white space

    Hi all,
    I need to insert some white space (the number of these white space is depending to some condition) in a form field.
    I show in my report a value and then I must complete this value with some white space to have finally a string with a fixed number of characters.
    I have a form field with a value (<?VALUE?>) and then I would insert a new form field to show only some white space. I can not add these white space directly on the field form containing the value.
    Thanks

    Balaji wrote:
    I need insert white space into table which a VARCHAR2 column. Just insert it, Whats the issue?
    I would like to validate the below expression against the data in the column \S.* What is this expression and where did you get it from?
    I guess this pattern validates for non-whitespace characters. Anyone help me on this and explain what this pattern does?No in regular expression space is represented as [:space:]
    Please read {message:id=9360002}

  • PDF form field validation - 2 criterias?

    Does anyone know how can I get a numerical pdf form field to validate within a range as well as validate that the value is equal to or less than the value of another numerical field?
    Thanks!

    I think the following custom Validate script will do what you want:
    function range_validate1() {
        // Do nothing if field is blank
        if (!event.value) {
            return;
        // Initialize some variables
        var sError = "";
        var nMin = 0;
        var nMax2 = 2e6;
        var nVal = +event.value;  // Value user entered, converted to a number
        // Get the other field value, converted to a number
        var nMax1 = +getField("Text1").value;
        // If the value is less than the minimum
        if (nVal < nMin) {
            sError = "Please enter a value greater than or equal to: " + nMin;
        // If value exceeds the other field value...
        if (nVal > nMax1) {
            sError = "Please enter a value less than or equal to: " + nMax1;
        // If value exceeds the max. possible value   
        if (nVal > nMax2) {
            sError = "Please enter a value less than or equal to: " + nMax2;
        // Alert the user and reject the value
        if (sError) {
            app.alert(sError, 0);
            event.rc = false;
    // Call the function
    range_validate1();
    The function can be placed in a document-level JavaScript, but the last line should be the custom Validate script for the field. Replace "Text1" in the line containing the getField statement to the actual name of the other field.

  • URGENT - Can I predefine form fields dynamically??

    Hello,
    I am wondering if I can predefine forms (pdf-form-fields) by content coming from a database for example. So the user only needs to validate the information instead of writing it by himself before printing it for example. Can anyone help me please?
    Thanks in advance,
    M

    Martin,
    This is not appropriate for the Reader forum. I think it might be
    possible if you used xml based pdf forms rather than what is known as
    Acroforms/Acrobat forums. Please re-ask in the Acrobat LiveCycle
    Designer forum:
    Mike

  • Remove spaces and special characters from a form field

    Hi,
    I am tragically new to all of this, but am trying to create a form in Adobe Acrobat 9.  I am trying to use a Custom Format script to take inputs in a form field and automatically remove spaces and special characters (hyphens specifically).  For example, if a user inputs "RAN-99 06" I would like it to change to "RAN9906."  I found this script that will not let users input special characters
    if (!event.willCommit) {
        event.change = event.change.replace(/[\$#~%\*\*\^\-\(\)\+=\[\]\{\};\"\<\>\?\|\\\!]/g, "");
    And that's okay, but I can't figure out how to disallow spaces.  Also, the perference would be for a script to allow users to input the data as they like, but to clean it up after they leave the text field.
    Thanks in advance!

    From the description, I assume that the script is currently in the Keystroke event. In fact, that would be a most logical way to have it; simply ignore anything unwanted when entered.
    If you want to allow the user to enter anything, but "clean it up" when done, you would place your code in the Validate event. You will have to adjust your Regular Expression so that it works globally, but that's the whole difference. This will change the value.
    Note that you can also enter the code into the Format event. However, that would only change the visual representation of the value, but internally, the value would remain as entered.
    Hope this can help.
    Max Wyss.

  • Acrobat Pro Calculating form fields lose functionality after enabling document for Reader

    I have a problem that continues to come up increasingly. I thought I had found a work-around on some forums, but it is still causing trouble. Im hoping you can answer the question.
    I am creating a form that requires simple calculations (sum and add). I can get these calculations to work just fine. However, as soon as I enable the document for Adobe Reader, the form seems to get amnesia. It loses the ability to calculate. When I go into the fields again to look at them, they still show that they are supposed to calculate, but arent working. I have to clear the calculations and completely reset them all in order to get them to function again, but as soon as I save this enabled doc, it loses its functionality all over again.
    Frustrating.
    I did find a work-around on a forum, but have only gotten it to work once. It had something to do with closing and saving the document, then reopening it before entering the calculations.
    Is there a clear-cut solution to this problem? The forums were rife with people experiencing the same frustrations.
    Thanks ahead of time for your assistance.

    Nathan,
    It's fairly straighforward to set up a custom validation script for this, but it might not be immediately obvious how to do it. I'll use your form as an example. In it, you have a number of rows with a Quantity field where the user enters how many items are needed, a Price field that has as its default value the price for the item, and a Total field which is a calculated field and should be the product of the Quantity and Price fields. The only variable in the calculation is the value of the Quantity field, so this will be easy.
    The Validate event of a field gets triggered when the field value is committed. This happens when the user enters a value and presses Enter, Tab, clicks outside of the field, etc. What the script should do is take the value the user entered, multiply it by the value that's in the Price field, and set the value of the Total field. The script could look something like:
    (function () {
        // Get the value of this field, as a number
        var qty = +event.value;
        // Get the value of the Price field, as a number
        var price = +getField("PRICE.0").value;
        // Calculate the total
        var total = qty * price;
        // Set the value of the Total field if not zero,
        // otherwise, blank it out
        getField("TTL.0").value = total ? total : "";
    What you really should do, however, is set up a document-level JavaScript (Advanced > Document Processing > Document JavaScripts...) that contains a function you can call from the QTY field of each row. The function will determine which row should be affected based on the field name that triggers it. Something like:
    function calcTotal() {
        // Get the row number from the field name
        // of the field that called this function
        var row = event.target.name.split(".").pop();
        // Get the value of the field that called this function, as a number
        var qty = +event.value;
        // Get the value of the Price field, as a number
        var price = +getField("PRICE." + row).value;
        // Calculate the total
        var total = qty * price;
        // Set the value of the Total field if not zero,
        // otherwise, blank it out
        getField("TTL." + row).value = total ? total : "";
    Than all you have to place as the custom Validate script of each of your QTY fields is the following:
    calcTotal();
    Also, make sure that you remove any calculations that you've set up on the Calculate tab of each TOTAL field. Now that the total fields do not rely on automatic calculations, it does not matter that the document is missing its field calculation order array, though this bug REALLY needs to be fixed. You should consider reporting it to Adobe. I will report it too.
    Note that this code assumes the QTY and PRICE fields are numeric fields, meaning they will either be blank or contain a valid number. You've ensured this by setting up each with a Format category of Number.
    George

  • Form Field Validation

    Hi All,
    I am new to PDF forms so sorry if this is a dumb question. I have a number field which I need it to validate the number of digits it must =13 or be blank.
    Is there a simple way to do this? I have set the field max size to 13 digits but I need to stop them inputting less than 13 digits it must match 13 exactly.
    Any help would be great.
    Many Thanks
    Adam

    You can use the following code as the custom Validate script for the field:
    // Custom Validate script
    if (event.value && event.value.length !== 13) {
        // Let the user know something is wrong
        app.alert("Please enter a total of 13 digits.", 3);
        // Optionally, reject the value if only 1-12 characters
        event.rc = false;
    That last line of code will reject the entry if there are from one to twelve characters. Just leave it out if that's not what you want to do.

  • Bogus web form field entry

    In my secure zone areas that have web forms I find Random letters in web form fields from persons who are not prviding required info in fields.
    Is there a way to validate web form entry in certain fields? 

    Hi Will,
    When you form a web form in BC when you tick that it is required that is added to the javascript that is at the bottom of the form. That only stops if it is empty or not.
    To have validation on fields that is more advanced you need to look to use something like this:
    http://jqueryvalidation.org/

  • Automatically displaying the error text for a form field when the validator fails?

    Hi,
    Flex 2 has a very nice feature to display custom text next to
    a form field whose validation failed. But the user has to move the
    mouse over the form field to display the text. Is there a way to
    invoke this feature programmatically?
    What I would like to do is validate form fields on submit and
    - if validation fails for a form field - set focus on that form
    field and automatically display the custom error text in the red
    blurb. Focusing works fine but I cant' get the text to render...
    Markus

    Thanks Bregent.
    Weirdest thing...I just tried a Google search for a solution to this problem and came across another thread on this forum.  By the time I got to the bottom of it I realised one of those taking part was myself from years ago!  Jeesh, been here before or what!
    Changed my recordset to...
    <%
    Dim rsPROP__MMColParam
    rsPROP__MMColParam = "0"
    If (Request.Form("categoryID") <> "") Then
      rsPROP__MMColParam = Request.Form("categoryID")
    End If
    %>
    <%
    Dim rsPROP__MMColParam1
    rsPROP__MMColParam1 = "1"
    If (Request.Form("categoryID") <> "") Then
      rsPROP__MMColParam1 = Request.Form("categoryID")
    End If
    %>
    <%
    Dim rsPROP
    Dim rsPROP_cmd
    Dim rsPROP_numRows
    Set rsPROP_cmd = Server.CreateObject ("ADODB.Command")
    rsPROP_cmd.ActiveConnection = MM_cs_STRING
    rsPROP_cmd.CommandText = "SELECT prodid, product, categoryID FROM dbo.products WHERE ISNULL(?,0) = 0 OR categoryID = ?"
    rsPROP_cmd.Prepared = true
    rsPROP_cmd.Parameters.Append rsPROP_cmd.CreateParameter("param1", 5, 1, -1, rsPROP__MMColParam) ' adDouble
    rsPROP_cmd.Parameters.Append rsPROP_cmd.CreateParameter("param2", 5, 1, -1, rsPROP__MMColParam) ' adDouble
    Set rsPROP = rsPROP_cmd.Execute
    rsPROP_numRows = 0
    %>
    ...and it works fine.
    Appreciate the help. I would have taken your advice and done an If Else on the WHERE clause to acheive the same.
    Thank you.
    NJ

  • Turn Off Form Field Calculations When Printing

    I am using Acrobat 9 Pro, and I will be the first to admit, I'm not all that familiar with creating functions or adding codes.  Through trial and error, I have created a form that allows my clients to fill out certain form fields, and automatically totals up their entire order.  If no values are entered and someone prints the document, the section that calculates the total still prints with a $0.00 value. I do have some clients who prefer to print the form and fill it out manually.  My question is, is there a way to disable the form fields, so that when it prints out, the area that would normally calculate the total, would just print blank?  And is it possible to add a button or check box within the PDF that would allow the form fields to be toggled on and off?
    Or another option, is it possible to have the document NOT print any values that are zero or less?
    Thanks!!!!

    You can do some of that other sutff, but if you're using one of the built-in calculation methods and just want to have the field not show a zero result, you can add the following custom validate JavaScript:
    // Custom Validate script
    if (+event.value === 0) event.value = "";

Maybe you are looking for

  • CKPT : Terminating instance due to Error 472

    Hi All, I got the above error and the system stopped and restarted on the DR side. Snippet from Alert file before shutdown =========================== Wed Nov 27 22:39:12 2013 Thread 1 advanced to log sequence 10770   Current log# 2 seq# 10770 mem# 0

  • Need to download Acrobat 11 STANDARD

    My company purchased 22 licenses for Acrobat 11 STANDARD.  Where can I get the software?

  • WebDav suddenly very slow

    Today, WebDav became suddenly very slow on my iMac running the latest version of Mavericks. Yesterday everything was OK. When I try WebDav from my iPad things are OK, so I suspect something is wrong on my iMac. I already tried rebooting and resetting

  • Exact date range comparison

    I have payment table like this, Date | Store | payment 01/01/2012 | A | $300  01/01/2012 | B | $400  01/01/2012 | C | $500  01/02/2012 | A | $500 01/22/2015 | C | $300 I want to make a report like this,                               A                

  • Change the period labelling in the planning book

    Hi I want to change the period labelling in the planning book. currently it is showing default I want to customize it to January, february, etc. I know there is a user exit APODM006. but I want to know the process to do it. thank you