Question on HTMLB page form Validation

Hi Group,
How to validate a HTMLB page?
Like suppose, I have a few input fields and I hope we can go with using a Java Script in it to validate the form. But, how to do validate?
Please let me know how to valid some input fields in HTMLB page?
Thanks in advance.
Regards,
Vishnu.

ok what you are asking is,
if the check is successfull the form should get submitted and else it should not get submitted and stay on the same page.
define the htmlb:button with both onclientclick and onclick.
in on clientclick add your js.
in that js, if the check fails add the following line
htmlbevent.cancelSubmit = true;
sample code.
onClientClick = "var Check = false; Check = confirm('k2?');if(Check == false){ htmlbevent.cancelSubmit = true; }"
Regards
Raja

Similar Messages

  • Form validation working on one page, but not the other....

    Hope someone can help with this.
    I have a page below with a load of contact forms which all work fine :
    http://www.goodsafariguide.com/judges/judges.php
    I've trued to recreate (admittedly mostly by saving as....) the same functionality here :
    http://www.goodsafariguide.com/awardssite/judges/
    They do work when fulled in correctly, but there's a glitch with the validation.
    Basically when you fill in a form incorrectly, the page reloads, with the form's accordion closed. When you open it up, its showing the ugly looking error at the top of the form.
    Any ideas what's causing it to act like this, as opposed to the way it works in the first link?
    Thanks.

    Iain71 wrote:
    I've trued to recreate (admittedly mostly by saving as....) the same functionality here :
    http://www.goodsafariguide.com/awardssite/judges/
    They do work when fulled in correctly, but there's a glitch with the validation.
    When looking at the source code I note that - unlike the first page - this one doesn´t contain any references to the ADDT form validation libraries ("../includes/tng/scripts/FormValidation.js" and "../includes/tng/scripts/FormValidation.js.php"), meaning that the validation can´t work.
    Cheers,
    Günter

  • SunOne 7 FORM Validation & Initial page

    Hi All.
    I have an application running in a Sun One 7 Server. I use LDAP for validation and I have configured a FORM validation, with two html's for login and error.
    All goes OK, when I'm trying to get the initial JSP of the application, the login form comes. But when I validate, my browser calls an image of the JSP instead of the JSP.
    It seems like the JSP tryes to load this image and then the validation starts. But when I validate, Sun One don't remember that the JSP called the image and only load the image.
    I'm blocked and I don't find nothing in the documentation. In the logs nothing appears to be bad.
    Somebody could help me, please?
    Thanks a lot.
    Daniel.

    hi
    i need to authenticate the requests of my sun application server with an ldap server.
    u told that u have configured how to connect sun app sever and ldap server....
    I need to do the same for my project......so pls help me
    ill b thankful to u..
    u can mail ur reply at [email protected]
    [email protected]
    or here

  • Changing pop-up for form validating

    I have simple contact forms that are validated which makes sure the fields in the form are filled out and that it is a proper email address.
    I have 2 contact forms on the same page. On the first one the field name's and id's are "name", "email" and "question". If you click the submit button a pop-up come up with:
    The following error(s) occurred:
    - name is required.
    - email is required.
    - question is required.
    The second form has name's and id's are "name-main", "email-main" and "question-main". The pop-up comes up with:
    The following error(s) occurred:
    - name-main is required.
    - email-main is required.
    - question-main is required.
    The first one is OK but is their a way to change the second one to something more user friendly?

    snarble wrote:
    I am just using dreamweaver 5 form validator.
    Yeah, I just picked up your other thread so you can't use a 'class' as that's already assigned to the input tag.
    You could just forget the protocol about duplicating id's and repeat 'name' as the id for the second form. Only one form will be active at any given time.

  • PHP Form Validation and Insert Records

    Hi There,
    I've been scratching my head for 2 days and couldn't find a solution.
    Here is my problem:
    Go to http://ecopethandbags.com/contactTest.php and click the "Send Comments" button.
    You will see that the validation works.
    Now, go to http://ecopethandbags.com/contactTestInsert.php, this time, I've inserted the "Insert Record" server behavior.
    Click the "Send Comments" button again.
    You will see the ugly message like "Column 'firstname' cannot be null" in a plain white page.
    My question is:
    How can I insert the PHP form records in my database and take advantage of the form validation nicely like in http://ecopethandbags.com/contactTest.php
    I am attaching the files.
    Thank you for you help!

    boloco wrote:
    My question is:
    How can I insert the PHP form records in my database and take advantage of the form validation nicely like in http://ecopethandbags.com/contactTest.php
    Use simple PHP logic to merge the scripts together.
    Dreamweaver automatically puts the Insert Record server behavior code at the top of the script. You need to adapt it so that the validation is done first. If the validation succeeds, use the Insert Record server behavior. If not, redisplay the form.
    if (array_key_exists('send', $_POST)) {
      // validate the form input
      if (!$suspect && empty($missing)) {
      // send the mail
        if ($mailSent) {
        unset($missing);
        // insert the Insert Record server behavior code here

  • Tabular Form Validation - Save Correct Values

    I'm using Denes' example of tabular form validation. It finds the errors and displays the error messages, but I lose any values that were entered correctly. Do I need to use a collection to save them? I've been looking through older posts and one comment was that you'd only need a collection if you wanted to show the user the values they entered incorrectly. With Denes' logic it tells them what line had the error and what the original value was.
    DECLARE
      l_error   VARCHAR2 (4000);
    BEGIN
       FOR i IN 1 .. apex_application.g_f02.COUNT
       LOOP
          IF NOT TO_DATE (apex_application.g_f05 (i), 'YYYY')
                BETWEEN   TRUNC (TO_DATE (apex_application.g_f04 (i),'YYYY'))
                     AND  TO_DATE ('2008','YYYY')     THEN
                      l_error :=   l_error
                        || '</br>'
                        || 'Row '
                        || i
                        || ': Photo Inspection Year has to be greater than Date On Map and less than 2008 for '
                        || ' Map: '
                        || apex_application.g_f02 (i)
                        || '<br> Requested date: '
                        || apex_application.g_f05 (i);
          END IF;
          IF NOT TO_DATE (apex_application.g_f04 (i), 'YYYY')
                BETWEEN   TO_DATE ('1890','YYYY')
                     AND  TO_DATE ('2008','YYYY')     THEN
                      l_error :=   l_error
                        || '</br>'
                        || 'Row '
                        || i
                        || ': Date on map has to be between 1890 and 2008 for '
                        || ' Map: '
                        || apex_application.g_f02 (i)
                        || ' <br>Requested date: '
                        || apex_application.g_f04 (i);
          END IF;
       END LOOP;
       RETURN LTRIM (l_error, '</br>');Thanks,
    Susan

    It doesn't make sense to post your questions within a closed thread - start you own thread.
    It is possible to do that but you would need to save your data into a collection to keep the changes and display the error message on the same page.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Form validation from within composer - how to lock down admin forms??

    Hello we have many space admin level users who have the privilege to add content and remove it from their pages as they see fit, however when modifying pages from inside webcenter composer there is no validation on user input / error checking. This causes many problems with users entering things improperly, or even causing bugs (such as with content presenter - if you remove a file from UCM without removing it from the "add a file" template it will break the page).
    So my question is - how do I start adding form validation to all of these screens (such as those little wrenches in composer for a task flow, or customizable layout component)? Is there a way to customize form validation for all admin screens (space - manage all, app - administration, and composer screens)?
    Thanks,
    j

    Here is the custom validation script of your drop-down.
    Make sure you tick the option to commit the selected value immediately:
         var sNewSel = event.value;
         switch (sNewSel) {
           case "ProductNo1":
             this.getField("ItemDescription").value = "blah, blah";
             this.getField("Size").value = "blah, blah";
             this.getField("UnitPrice").value = "blah, blah";
             break;
         case "ProductNo2":
             this.getField("ItemDescription").value = "blah, blah";
             this.getField("Size").value = "blah, blah";
             this.getField("UnitPrice").value = "blah, blah";
             break;
         case "ProductNo3":
            this.getField("ItemDescription").value = "blah, blah";
            this.getField("Size").value = "blah, blah";
             this.getField("UnitPrice").value = "blah, blah";
             break;
         //etc.
    You will need to replace "ProductNoX" in the script with whatever your product numbers are in the drop down.
    You can also read MarkWalsh's script in this thread:
    http://forums.adobe.com/message/5578038#5578038
    I hope this helps.

  • Tabular Form Validation not working in tabular form APEX 4.0

    Hi,
    I am using APEX 4.0. I have a tabular form with Tabular form validation done with it.
    Item not null is the validation.. so if I dont type any value in the any of the fields in the tabular form and press the Submit button, the first time error is shown... but when I click the Submit button again, with still the empty rows the page is submitted.
    How to resolve this issue?
    Edited by: Suzi on Oct 5, 2010 11:13 AM

    Look at this thread - Re: Validations of tabular forms in 4.0

  • Why is my CSS style not applied to my HTMLB page ?

    Hello !
    I'm using a css file to define the layout of my htmlb page... but the layout is not applied.
    When I specify the layout CSS in a common html page the layout is applied but not for an htmlb page.
    Could someone let me know where I'm wrong ?
    EG :
    My htmlb page :
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content>
      <htmlb:page title=" " >
          <html>
                <head>
                <link href="style.css" rel="stylesheet" type="text/css">
                </head>
                <body>
                text1
        <htmlb:form>
            text2
        </htmlb:form>
                </body>
          </html>
      </htmlb:page>
    </htmlb:content>
    My css file style.css :
    <%@page language="abap"%>
    body {
        background-color: #990000;
        font-family: Verdana;
        font-size: 32x;
        line-height: 32px;
        color: #666666;
    As a result, I have a blank page (and not red) with the text "text1" and "text2" written.

    This code you have is unfortunately completely bogus. It is just not going to work. Writing HTMLB tags are easy. It takes but minutes to make the magic appear in the browser. But, you have also have to understand a little about what is happening.
    At a very first, I would like to recommend this link: <a href="/people/brian.mckellar/blog/2004/06/11/bsp-trouble-shooting-getting-help">Getting Help</a>. You are specifically interested in the section that shows you how to get help about specific tags.
    As a next step, look at the help for the <htmlb:page> tag. It is the first important one. See how it is a collection of other <htmlb:document*> tags.
    Thereafter, look at SBSPEXT_HTMLB/document.BSP for an example on how to replace the <htmlb:page> sequence in your application.
    Once this is done, place you "<link ...>" sequence directly after the <htmlb:headInclude> tag that you have now on your page.
    Compile, test, assign 10 points.

  • Multiple page form to email with sessions doesn't send mail

    I am creating a multiple page form where a user can apply for finance. I am trying to use session to keep the user input values and then the last page sent the application by email.
    My problem is the last step where it doen't send the email. I'm not sure if it the session I'm using is wrong because a simple form without sessions works fine.
    here are the forms
    First page is the input for with variables
    <form action="Finance_form_proposal_Address.php" method="post" >
      <span id="sprycheckbox1">
      <input  name="Disclaimer" type="checkbox" value="yes">
      <span class="checkboxRequiredMsg">Please confirm that you have read and understood the Terms and Conditions.</span></span>
      <div id="F1"><table width="100%" border="1" align="center" cellpadding="3" cellspacing="2">
      <tr>
        <td align="right" bgcolor="#F7E4F8" ><strong>Title:</strong></td>
        <td align="left" bgcolor="#F7E4F8"><select name="Title">
              <option value="Mr">Mr</option>
              <option value="Mrs">Mrs</option>
              <option value="Miss">Miss</option>
              <option value="Ms">Ms</option>
              <option value="Dr">Dr</option>
              <option value="Rev">Rev</option>
            </select></td>
    etc..
    </form>
    The second form:
    Getting values and input new form
    <?php session_start();
    $_SESSION['Disclaimer'] = $_POST['Disclaimer'];
    $_SESSION['Title'] = $_POST['Title'];
    $_SESSION['Forname'] = $_POST['Forname'];
    $_SESSION['Middle_name'] = $_POST['Middle_name'];
    $_SESSION['Surname'] = $_POST['Surname'];
    $_SESSION['email'] = $_POST['email'];
    $_SESSION['DOB'] = $_POST['DOB'];
    $_SESSION['DOB2'] = $_POST['DOB2'];
    $_SESSION['DOB3'] = $_POST['DOB3'];
    $_SESSION['Gender'] = $_POST['Gender'];
    $_SESSION['checkboxGroup1'] = $_POST['checkboxGroup1'];
    $_SESSION['checkboxGroup2'] = $_POST['checkboxGroup2'];
    $_SESSION['home_phone'] = $_POST['home_phone'];
    $_SESSION['mobil'] = $_POST['mobil'];
    $_SESSION['marital_status'] = $_POST['marital_status'];
    $_SESSION['Occupancy'] = $_POST['Occupancy'];
    $_SESSION['Dependants'] = $_POST['Dependants'];
    ?>
    Form on second page
    <form action="Finance_form_proposal_Bank_Details_employment.php" method="post"> <input  name="Disclaimer" type="checkbox" value="yes">
        <div id="F1"><table width="100%" border="1" align="center" cellpadding="3" cellspacing="2">
      <tr>
        <td align="right" bgcolor="#F7E4F8" ><strong>Correspondence Address:</strong></td>
        <td align="left" bgcolor="#F7E4F8"><input name="Correspondence" type="checkbox" id="Correspondence" value="yes" checked="CHECKED">
          <label for="Correspondence"></label></td>
      </tr>
      <tr>
        <td bgcolor="#F7E4F8"><strong>Street:</strong></td>
        <td bgcolor="#F7E4F8"><input name="Street" type="text"></td>
      </tr>
      <tr>
        <td bgcolor="#F7E4F8"><strong>District:</strong></td>
        <td bgcolor="#F7E4F8"><input name="District" type="text"></td>
      </tr>
      <tr>
        <td bgcolor="#F7E4F8"><strong>Town:</strong></td>
        <td bgcolor="#F7E4F8"><input name="Town" type="text"></td>
      </tr>
    etc ..
    </form
    Third page
    Getting values
    session_start();
    $_SESSION['Correspondence'] = $_POST['Correspondence'];
    $_SESSION['Street'] = $_POST['Street'];
    $_SESSION['District'] = $_POST['District'];
    $_SESSION['Town'] = $_POST['Town'];
    $_SESSION['County'] = $_POST['County'];
    $_SESSION['Country'] = $_POST['Country'];
    $_SESSION['Years'] = $_POST['Years'];
    $_SESSION['Months'] = $_POST['Months'];
    $_SESSION['Street2'] = $_POST['Street2'];
    $_SESSION['District2'] = $_POST['District2'];
    $_SESSION['Town2'] = $_POST['Town2'];
    $_SESSION['County2'] = $_POST['County2'];
    $_SESSION['Country2'] = $_POST['Country2'];
    $_SESSION['Years2'] = $_POST['Years2'];
    $_SESSION['Months2'] = $_POST['Months2'];
    $_SESSION['Street3'] = $_POST['Street3'];
    $_SESSION['District3'] = $_POST['District3'];
    $_SESSION['Town3'] = $_POST['Town3'];
    $_SESSION['County3'] = $_POST['County3'];
    $_SESSION['Country3'] = $_POST['Country3'];
    $_SESSION['Years3'] = $_POST['Years3'];
    $_SESSION['Months3'] = $_POST['Months3'];
    Then there is a another form to fill in , wont show that as it is in principle the same.
    This is the last page that should sent the data to email:
    <?php
    session_start();
    /* Subject mail variables */
    $emailsubject = 'Finance application from PandKshop';
    $webmaster = '[email protected]';
    /* Gathering Data */
    $goods = $_POST['goods'];
    $amount = $_POST['amount'];
    $Total_Cash = $_POST['Total_Cash'];
    $Deposit = $_POST['Deposit'];
    $Balance = $_POST['Balance'];
    $Payments = $_POST['Payments'];
    $Diclaimer = $_SESSION['Disclaimer'];
    $Title = $_SESSION['Title'];
    $Forname = $_SESSION['Forname'];
    $Middle_name = $_SESSION['Middle_name'];
    $Surname = $_SESSION['Surname'];
    $email = $_SESSION['email'];
    $DOB = $_SESSION['DOB'];
    $DOB2 = $_SESSION['DOB2'];
    $DOB3 = $_SESSION['DOB3'];
    $Gender =  $_SESSION['Gender'];
    $CheckboxGroup1 = $_SESSION['CheckboxGroup1'];
    $CheckboxGroup2 = $_SESSION['CheckboxGroup2'];
    $home_phone = $_SESSION['home_phone'];
    $mobil_phone = $_SESSION['mobil_phone'];
    $marital_status = $_SESSION['marital_status'];
    $Occupancy = $_SESSION['Occupancy'];
    $Dependants = $_SESSION['Dependants'];
    $Correspondence = $_SESSION['Correnspondence'];
    $Street = $_SESSION['Street'];
    $District = $_SESSION['District'];
    $Town = $_SESSION['Town'];
    $County = $_SESSION['County'];
    $Country = $_SESSION['Country'];
    $Years = $_SESSION['Years'];
    $Months = $_SESSION['Months'];
    $Street2 = $_SESSION['Street2'];
    $District2 = $_SESSION['District2'];
    $Town2 = $_SESSION['Town2'];
    $County2 = $_SESSION['County2'];
    $Country2 = $_SESSION['Country2'];
    $Years2 = $_SESSION['Years2'];
    $Months2 = $_SESSION['Months2'];
    $Street3 = $_SESSION['Street3'];
    $District3 = $_SESSION['District3'];
    $Town3 = $_SESSION['Town3'];
    $County3 = $_SESSION['County3'];
    $Country3 = $_SESSION['Country3'];
    $Years3 = $_SESSION['Years3'];
    $Months3 = $_SESSION['Months3'];
    $Sort_Code          = $_SESSION['Sort_Code'];
    $Account = $_SESSION['Account'];
    $Years_with_Bank = $_SESSION['Years_with_Bank'];
    $Months_with_Bank = $_SESSION['Months_with_Bank'];
    $CreditCard = $_SESSION['CreditCard'];
    $ChequeCard = $_SESSION['ChequeCard'];
    $Employment = $_SESSION['Employment'];
    $income = $_SESSION['Income'];
    $Income2 = $_SESSION['Income2'];
    $Occupation = $_SESSION['Occupation'];
              $Body = <<<EOD
    <br><hr><br>
    Goods: $goods <br>
    Amount: $amount <br>
    Total Cash: $Total_Cash <br>
    Deposit: $Deposit <br>
    Balance: $Balance
    Nine Monthly Payments of : £ $Payments
    Title: $Title <br>
    Forname: $Forname <br>
    Middle Name: $Middle_name <br>
    Surname : $Surname <br>
    Email: $email <br>
    DOB: $DOB/$DOB2/$DOB3 <br>
    Gender: $Gender <br>
    Home_phone: $CheckboxGroup1 Mobile phone: $CheckboxGroup2 <br>
    Home Phone number: $home_phone <br>
    Mobile Phone number: $mobil_phone <br>
    Marital_Status: $marital_status <br>
    Occupancy : $Occupancy <br>
    Dependants: $Dependants <br>
    Correspondence Address: $Correspondence <br>
    Street: $Street <br>
    District: $District <br>
    Town: $Town <br>
    County: $County <br>
    Country: $Country
    Years: $Years
    Months: $Months
    Street2: $Street <br>
    District2: $District2 <br>
    Town2: $Town2 <br>
    County2: $County2 <br>
    Country2: $Country2
    Years2: $Years2
    Months2: $Months2
    Street3: $Street3 <br>
    District3: $District3 <br>
    Town3: $Town3 <br>
    County3: $County3 <br>
    Country3: $Country3 <br>
    Years3: $Years3 <br>
    Months3: $Months3 <br>
    Sort Code: $Sort_Code <br>
    Account: $Account <br>
    Years with the Bank: $Years_with_Bank <br>
    Months with the Bank: $Months_with_Bank <br>
    CreditCards: $CreditCard <br>
    Cheque Card: $ChequeCard <br>
    Employment: $Employment <br>
    Income: £$income <br>
    Income Frequency: $Income2 <br>
    Occupation: $Occupation <br>
    EOD;
              $headers = "From: $email\r\n";
              $headers .= "content-type: text/html\r\n";
              $succes = mail($webmaster, $emailsubject, $Body, $headers);
    session_destroy();
    /* Results rendered as HTML */
    $theResults = <<<EOD
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
    <head>
          <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
          <title>Thank you! The Piano and Keyboard Shop Online</title>
          <link rel="STYLESHEET" type="text/css" href="contact.css">
          <link href="The Piano and Keyboard Shop.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <h2>Thanks for your application!<br />
    We endavour to get back to you as soon as possible with application results</h2>
    Please contact us on 0116 2541053 if you have any questions regarding your finance application
    Return to <a href="../index_main.php">Home Page</a>
    <div id="advertising">
        <div id="add_left"><a href="Contact.php">Contact us</a><br>
          <a href="About.php">About us</a><br>
          <a href="Finance.php">Finance</a><br>
    </div>
        <div id="adds_middle"><a href="term-conditions.php">Terms and Conditions</a><br>
          <a href="Privacy-Policy.php">Privacy Conditions</a><br>
          <a href="FAQ.php">FAQ</a><br>
    </div>
        <div id="adds_right"><a href="http://www.youtube.com/user/KeysoundWebsite">Follow us on YouTube</a><br>
          <a href="https://twitter.com/KeysoundUK">Follow us on Twitter</a><br>
          <a href="https://www.facebook.com/pages/Keysound/163590297024385">Follow us on Face book</a><br>
    </div>
      </div>
      <div id="advertising"> <div id="copy"><img src="files/Images/copyright.gif" width="19" height="22">
    </div> </div>
    </body>
    </html>
    EOD;
    echo "$theResults";
    ?>
    Is there something wrong with my sessions or just something in the code?

    Standard Apple Mail. I'm running Yosemite 10.10.1, and I'm amazed to see that About Mail says it's Mail Version 8.1 (1993), copyright 1995-2014 Apple Inc. 
    Interesting thought, do you think that it doesn't like to work with itself?  Actually, I'm fairly sure I've had the problem inside of other apps but I should document that.  I'll keep notes to see where this happens. 

  • Is there a way to bypass the form Validation

    I'm getting really upset with the Coldfusion built-in form validation for any HTML formfield ending by _date , _required, _time and so on...
    My application proposes to the users to create some Properties for an object and later on to modify the values for all these properties.
    I've got a piece of code building dynamically some form fields named just like the properties (by a simple cfloop on a DB query getting the property list).
    And a registering page to records the new value in the DB.
    But it crashes onto the classical "
    Form entries are incomplete or invalid.
    I can't control what the users set as property name (one of them was Checklist_required).
    Is there any way to prevent this error by disabling this auto validation ?
    (I'd like to avoid having to rename any field dynamically created and rename any forms variables before registering them on the DB : it's just NO WAY for me to rename the properties created by the users)

    Fober1, that's not how it works.  It's pretty much the ultimate example of the disjoint between how HTML forms work and how the naive CFML Cfform / cfinput design wished they work.
    When a request is being processed by the coldfusion server, it just looks at the list of FORM (POST) variable names (whether it came from cfform or not; URL/GET params are exempt), and for those with certain suffixes (_date, _required, etc.), and it assumes their existence is intended to request validation another field without that suffix.  It doesn't actually know or care whether form submission, nor the HTML rendered in the user's browser, actually came from "cfform" or "cfinput".   The composition of the request that comes in (when a user clicks on "submit", or a hacker uses any tool imaginable) is out of the server's hands.  The cfform code is not used during form submission processing, because the receiving template (the form action="this_one.cfm") doesn't even have to be the same template that has the cfform in it. There could be multiple conflicting cfforms directing users to request the same template on a single site, with or without the validation, even without considering what a whole other person might decide to send to your server.
    The fact that it can work as intended for a typical user is irrelevant, because the purpose of validation is to deal with the atypical situation.  A malicious or merely mischievous user that wanted to circumvent the validation would simply modify a copy of the page to leave out the "validation request" fields.    For the developer to truly validate the input, additional code must be written, making the feature not only inadequate, but a complete waste of time.  There absolutely should be a way to disable it at worst; Ideally, it would be taken out of coldfusion completely.  It's not only useless, it's a security risk, wooing programmers to write code that doesn't do what they think it does.
    The error message it gives isn't so great, either, and it's a pity that it can't show more than one validation message at a time, either.  If more than one input is invalid, you could end up going through one round after another of submit + back button.
    edit: I forgot to add the other important reason that this feature should never have existed: It is a nuisance to everyone else who doesn't want to use it at all, too!  Those suffixes simply couldn't have been a worse choice, colliding with probably thousands of peoples' variable names.  Why not "*_cfval_date" "*_cfval_time" etc?

  • Page level validation to prevent duplicate data entry into the database

    Hello,
    Can anyone please help me out with this issue.
    I have a form with two items based on a table. I already have an item level validation to check for null. Now I would like to create a page level validation to check that duplicate data are not entered into the database. I would like to check the database when the user clicks on ‘Create’ button to ensure they are not inserting duplicate record. If data already exist, then show the error message and redirect them to another page. I am using apex 3.2
    Thanks

    Hi,
    Have you tried writing a PLSQL function to check this?
    I haven't tested this specifically, but something like this should work:
    1) Create a Page Level Validation
    2) Choose PLSQL for the method
    3) Choose Function Returning Boolean for the Type
    For the validation code, you could do something like this:
    DECLARE
        v_cnt number;
    BEGIN
        select count(*)
        into v_cnt
        from
        your_table
        where
        col1 = :P1_field1 AND
        col2 = :P2_field2;
        if v_cnt > 0 then return false;
        else return true;
        end if;
    END;If the query returns false, then your error message will be displayed.
    Not sure how you would go about redirecting after this page though. Maybe just allow the user to try again with another value (in case they made a mistake) or just press a 'cancel' button to finish trying to create a new record.
    Amanda.

  • Variations of a fixed content multi page Form

    Problem Statement:
    There are two variations of a fixed content page Form. This form runs for multi-pages say 10 pages of fixed content. One variation has an additional 4 to 5 line fixed text contents enclosed by a rectangular box object at the top of the page right below the title of the Form on the first page and there no other differences Vs the second variation.
    Approach:
    The form is created using a multiple page Section.
    Question:
    Can we avoid creation of multiple version of Sections in Documaker with use of any special Studio rules to insert the conditional rectangular box object with the 4 to 5 line contents between the Title of the form and the first paragraph based on a trigger?
    Assume that the First version and the second version of the form contents can be differentiated with a trigger or signal say "0" or "1" in the extract.
    Edited by: Nirmalgarga on 16 Dec, 2010 12:07 AM
    Edited by: Nirmalgarga on 16 Dec, 2010 3:06 AM

    Dynamic growing rectangles are supported in Documaker, review the Rule Book for the GorupBegin rule. This rule needs to be implemented at the section level.
    A box can also be place around a text area as a border. You can implement this as only one section using a variety of options, however its not clear what is making the section different in the first place. If its variable data then I'd try the border around the text area first - it is the easier option of the two.
    The grouping rules were specifically designed to support dynamic rectangles when you have overflow/repeating data versus what could be contained in a text area. There is some additional detail that would be needed to determine the optimal way of implementing this need.

  • What is your strategy for form validation when using MVC pattern?

    This is more of a general discussion topic and will not necessarily have a correct answer. I'm using some of the Flex validator components in order to do form validation, but it seems I'm always coming back to the same issue, which is that in the world of Flex, validation needs to be put in the view components since in order to show error messages you need to set the source property of the validator to an instance of a view component. This again in my case seems to lead to me duplicating the code for setting up my Validators into several views. But, in terms of the MVC pattern, I always thought that data validation should happen in the model, since whether or not a piece of data is valid might be depending on business rules, which again should be stored in the model. Also, this way you'd only need to write the validation rules once for all fields that contain the same type of information in your application.
    So my question is, what strategies do you use when validating data and using an MVC framework? Do you create all the validators in the views and just duplicate the validator if the exact same rules are needed in some other view, or do you store the validators in the model and somehow reference them from the views, changing the source properties as needed? Or do you use some completely different strategy for validating forms and showing error messages to the user?

    Thanks for your answer, JoshBeall. Just to clarify, you would basically create a subclass of e.g. TextInput and add the validation rules to that? Then you'd use your subclass when you need a textinput with validation?
    Anyway, I ended up building sort of my own validation framework. Because the other issue I had with the standard validation was that it relies on inheritance instead of composition. Say I needed a TextInput to both check that it doesn't contain an empty string or just space characters, is between 4 and 100 characters long, and follows a certain pattern (e.g. allows only alphanumerical characters). With the Flex built in validators I would have to create a subclass or my own validator in order to meet all the requirements and if at some point I need another configuration (say just a length and pattern restriction) I would have to create another subclass which duplicates most of the rules, or I would have to build a lot of flags and conditional statements into that one subclass. With the framework I created I can just string together different rules using composition, and the filter classes themselves can be kept very simple since they only need to handle a single condition (check the string length for instance). E.g. below is the rule for my username:
    library["user_name"] = new EmptyStringFilter( new StringLengthFilter(4,255, new RegExpFilter(/^[a-z0-9\-@\._]+$/i) ) );
    <code>library</code> is a Dictionary that contains all my validation rules, and which resides in the model in a ValidationManager class. The framework calls a method <code>validate</code> on the stored filter references which goes through all the filters, the first filter to fail returns an error message and the validation fails:
    (library["user_name"] as IValidationFilter).validate("testuser");
    I only need to setup the rule once for each property I want to validate, regardless where in the app the validation needs to happen. The biggest plus of course that I can be sure the same rules are applied every time I need to validate e.g. a username.
    The second part of the framework basically relies on Chris Callendar's great ErrorTipManager class and a custom subclass of spark.components.Panel (in my case it seemed like the reasonable place to put the code needed, although perhaps extending Form would be even better). ErrorTipManager allows you to force open a error tooltip on a target component easily. The subclass I've created basically allows me to just extend the class whenever I need a form and pass in an array of inputs that I want to validate in the creationComplete handler:
    validatableInputs = [{source:productName, validateAs:"product_name"},
                         {source:unitWeight, validateAs:"unit_weight", dataField:"value"},
                   {source:unitsPerBox, validateAs:"units_per_box", dataField:"value"},
                        {source:producer, validateAs:"producer"}];
    The final step is to add a focusOut handler on the inputs that I want to validate if I want the validation to happen right away. The handler just calls a validateForm method, which in turn iterates through each of the inputs in the validatableInputs array, passing a reference of the input to a suitable validation rule in the model (a reference to the model has been injected into the view for this).
    Having written this down I could probably improve the View side of things a bit, remove the dependency on the Panel component and make the API easier (have the framework wire up more of the boilerplate like adding listeners etc). But for now the code does what it needs to.

  • Script for Form validator in head causes error

    When I use the Window/Behaveiors/ to create a form validator, Dreamweaver CS5 puts script in the Head of page, and seems to work ok. But when I validate page with W3c it says there are errors with code and as Dreamweaver created this I have no idea what to do to put right, so could someone please help. This is code generated by Dreamweaver, all other pages have past with flying colors!
    <script type="text/javascript">
    function MM_validateForm() { //v4.0
      if (document.getElementById){
        var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
        for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
          if (val) { nm=val.name; if ((val=val.value)!="") {
            if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
              if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
            } else if (test!='R') { num = parseFloat(val);
              if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
              if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
                min=test.substring(8,p); max=test.substring(p+1);
                if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
          } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
        } if (errors) alert('The following error(s) occurred:\n'+errors);
        document.MM_returnValue = (errors == '');
    </script>

    If the script is working fine in all browsers, you could put it in an external JS file and link to it, then the W3C validator won't find an error.
    If you don't know already, learn about how to do this:
    http://www.hypergurl.com/jsfiles.html

Maybe you are looking for

  • Follow up question: Is there a way to wirelessly use Airtunes and internet

    I had marked this post as resolved, but things have subsequently become quite 'unresolved.' This is my original thread where I explain the problem and Tesserax provides an answer: http://discussions.apple.com/thread.jspa?threadID=1702063&tstart=0 Her

  • Inserting a node in XML and retaining the doc type

    Hi All, I want to insert one new node in an XML. Using the following code I can do that. But the problem is if the XML has doc type declaration then its giving me problem. After inserting the node the transformer is removing my doc type declaration f

  • Can the order of Account segmentation types be changed?

    Hi Forum, I believe it can not be, but would like to confirm from the experts. When we create a company with segmentation, the system generates four default segments - Natural Account, Division, Region and Department. Most other ERP systems have it a

  • Not possible to unlock lock on admin account

    HELP! I am running 10.6. but recently reinstalled it as time machne made problems. Since then I can't unlock the lock on my admin account, and can't update or install any apps at all, including the software updater for 10.6.1. It just freezes with no

  • CC 2014 Imported MP4 clips no longer work

    I had been working on a project in CC and it contained several MP4 clips.  These work fine and have video and audio. Yesterday, I updated CC Pro to CC Pro 2014. I opened the project in 2014 and it told me I needed to convert the project file to the n