Right way to validate form fields !!

Hi,
I am having a form with many fields including TextFields, Dropdowns, DateFields, Checkboxes, Radiobuttons etc.
I am validating the most fields by making them REQUIRED. But I didn't found way to make Checkbox field required. So I am doing it by script by making its MANADATORY property to true. I am validating fields at the Form's preSubmit event.
All I want to know that whether it is the right way to validation i.e.
Making field.mandatory = true; (for checkboxes or may be some other field too)
Check it at preSubmit event of the form;
I want to code it according to best practices. That's why this question bounces up in the mind.
Thanks.
Abhinav

Thank you for your replies!
I understand how to get data into a JCombobox,
but what about my bigger, general question?
"I am confused because in other parts of my program I get a database connection and am not sure if you just form a query each time you need data or store the results somewhere (vector, array, collection)and use it this way." when the data or parts need to be used again.
This is the help I need.
Thanks again1
Alan

Similar Messages

  • Is there a way to create form fields to tab into and type and or drop down selection fields in pages as you can with microsoft word?

    is there a way to create form fields to tab into and type and or drop down selection fields in pages as you can with microsoft word?

    No

  • Captions - Is there a way to add form field captions in Acrobat Pro XI similar to LiveCycle?

    I lost LiveCycle in the CreativeCloud transition and form field captions were easy. Is there an easy way to make form field captions in Acrobat Pro XI? Or do I just need to create separate caption fields for each field? I hope I'm just missing something obvious...

    I know. Is there a way to tie the caption to the field similar to LiveCycle?
    Thanks for your help.

  • Right way of login form...

    Hello
    I am a really newbie in web programming. I want to write a web application with JSF. I wonder what is the rgiht way of creating the login form. I tried to write a page segment file for it but page segments do not have prerender method so it cannot be fully controlled...I want something like that:
    login control will be two parts..
    if login info is not found in session, than it will show the login form.
    if the user is found in session, than it will show the menu for the user...
    but i couldnt do that because prerender methos is not available in page segments..
    what is the right way for doing that kind of thing?

    Indeed implement a Filter.
    Once an user logs in, put the User object in the HttpSession. Let the filter check on this User object. If this User object is null and you're not in the login page, then redirect to the login page.
    Do a Google search on "LoginFilter implements Filter" or "UserFilter implements Filter" and you'll find lot of examples.
    http://www.google.com/search?q=%22LoginFilter implements Filter%22
    http://www.google.com/search?q=%22UserFilter implements Filter%22
    Here is an advanced one which actually doesn't redirect if the User object doesn't exist, but this might give you some new insights: http://balusc.xs4all.nl/srv/dev-jep-usf.html

  • Is there a sensible way to import form fields from an old pdf into a new pdf?

    I'm working with Acrobat X Pro on a Windows PC platform.  I've been working with a file that was originally created in CorelDraw X3, in landscape orientation. That document was then saved as a pdf and set up with many form fields (it's an order form). The document needed to be updated with minor changes made in the Corel file. I resaved as a pdf and now want to transfer the existing form fields from the old document into the newly revised one. I've tried copy/paste, but have to do small sections at a time because the program doesn't let me bring in all of the fields at the same time. I then tried Document > Replace page, which I've seen described in other forum posts; but when I do that, the entire set of fields comes in rotated at 90 degrees counterclockwise. I did read that if the original document was created in a different orientation, that could affect how the fields paste in, but that is not the case here. The original file, and all successive pdf files all have been the same orientation. I'm boggled and think that there has to be an easier way than copying fields, a section at a time, and resizing them all over again.
    This older post is pretty similar to what I am trying to do, but it seems I'm getting a different end result. Any suggestions?
    Create fillable form with changing source document

    I am using Acrobat Pro 10. I have the same problem and finally after numerous different attempts of solving based on all the suggestions, I resolved my problem by Printing to PDF via the print dialog in Word. When I pasted the fields that were previously rotating onto the new "printed" PDf, the fields retained their orientation as desired.
    To clarify, I am using Word 2007, Acrobat Pro 10, the document is landscape, both the original (with fields) PDF and all attempted new PDF's were of the diemnsions 11 x 8.5. The only noticeable difference in the PDF properties for the PDF's were Tagged PDF and Fast Web View. The original PDF (with fields) was No in both cases and all attempts other than the Print to PDF were Yes, meaning that the Print to PDF was No. I am not sure if this made the Print to PDF work or not as I have already spent too much time trying to resolves this issue. Hope this helps.

  • 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

  • Best way to validate currency field based on two picklists

    Hi,
    Im having a great deal of trouble creating validation for the following statement:
    If (Task type =”Call” or “Callback”) and (‘Outcome Category’ is “In Progress” or “Tried and Failed to Save” or “Saved”) then (‘Total Value of Policy’ must be > 0)
    Both task type and outcome category are picklist items.
    What is the easiest way for me to do this? Ive created something horribly complex which only works when I first create the record (possibly because of the use of FieldValue rather than stored values). Ive seen people use the NOT function before to do this - could this be an option?! Ive had no luck with anything Ive tried so far.
    My current expression is as follows:
    (FieldValue('<cTotal_Value_of_Policy_ITAG>') > 0
    AND FieldValue('<Type>') <> LookupValue("TODO_TYPE", "Investigation") - - Because call or callback are the only other options in the list.
    AND (FieldValue('<IndexedPick2>') <> LookupValue("OCC_INDEX_CUST_LOV_EVT_ACT_2", "In progress")
    OR FieldValue('<IndexedPick2>') <> LookupValue("OCC_INDEX_CUST_LOV_EVT_ACT_2", "Tried & failed to save")
    OR FieldValue('<IndexedPick2>') <> LookupValue("OCC_INDEX_CUST_LOV_EVT_ACT_2", "Saved")))
    OR FieldValue('<Type>') = LookupValue("TODO_TYPE", "Investigation")
    OR (FieldValue('<Type>') = LookupValue("TODO_TYPE", "Call")
    AND (FieldValue('<IndexedPick2>') <> LookupValue("OCC_INDEX_CUST_LOV_EVT_ACT_2", "In progress")
    AND FieldValue('<IndexedPick2>') <> LookupValue("OCC_INDEX_CUST_LOV_EVT_ACT_2", "Tried & failed to save")
    AND FieldValue('<IndexedPick2>') <> LookupValue("OCC_INDEX_CUST_LOV_EVT_ACT_2", "Saved")))
    Sorry for including this confusing chunk of code, but I think it explains how more complex i have made this than i probably need to!!
    Any help would be greatly appreciated as this is quite an urgent issue..
    Many Thanks
    AJ

    Anon,
    In your edit form, create two hidden items p10_ha, p10_hb (for e.g.) Make the default values for these items as values of p10_item_a and p10_item_b respectively. So when you are processing the update, you have old values in hidden items and new values in p10_item_a and b.
    Now create 'after submit' pl/sql computation and put similar code
    if p10_ha !=1 and p10_hb !=1 then
        if p10_item_a = 1 and p10_item_b = 1 then
        -- your business logic here   
       :p_date_item := sysdate;
       end if;
    end if;Hope it helps
    Cheers
    Hari
    Edited by: Hari_639 on Oct 27, 2009 9:21 AM

  • Is there a way for a form field to show a name when the client sees it, but have the name disappear

    My client needs a PDF with fields. It's a letter. They want the areas for the header - names/addresses/company name/date, etc. to be variable, but when THEIR client looks at it, they want them to know what the field is. So they want the field labeled. But when the client then types in the field, they want that label to disappear.
    This one has me stumped! Thanks!

    In a text field, use Options > Default value. The user will have to delete what you write there when entering new text, or you'll get both.

  • Single and double quotes entered in form field cause corruption?

    I am creating a database change request system using in APEX 2.2 and the main form has a description field (clob) and a API_description field (varchar2(4000)) that are text area fields on the page. The form seems to have trouble when the string data entered into the text area page items on the form contain single and double quotes.
    <br><br>
    I have pasted my test data below in this problem description(this is not true sql but it gets the point accross). I use the wizard created insert process to get the data into the db from the text fields in the wizard generated form, then use the wizard created fetch process to get the data back out and rendered on the same form. When I use the test data below, sometimes a few characters dissappear from my input data on the way out, sometime form fields go away, and their html is interspersed with the previous form field's data on the page. And I get different results on different tests with the same data.
    <br><br>
    Do I have to do something special for a vanilla htmldb text page item on a form to be able to receive single and double quotes in the string input in order to avoid that string data confusing the processing on the way in to the Database or on the way out for rendering?
    <br><br>
    Do I have to escape the characters? How do I do this?
    <br><br>
    The "varchar2(1) := ‘A’" part of the below TEST DATA string seem to cause the most trouble. The behavior is erratic - sometimes the pattern works, sometimes html is interspersed in one place, sometimes another (on the way back out)
    <br><br>
    START TEST DATA:
    Add column pcl3_data_ind varchar2(1) to edc_tran,edc_log, edc_recreate_tran table
    Or
    Create a file with following sql in it
    Insert into sometable values(‘A’,sysdate);
    Or
    create new table as follows
    create table “someschema”.“sometable”
    (id number not null,
    Name varchar2(20) not null,
    Join_date sysdate
    Active varchar2(1) := ‘A’
    END TEST DATA:
    <br><br>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Here is an example of the test data being displayed after being fetched back out of oracle (this will look like gibberish when rendered in the forum system (end of problem description except for example):
    <br><br>
    env
    Add column pcl3_data_ind varchar2(1) to edc_tran,edc_log, edc_recreate_tran table
    Or
    Create a file with following sql in it
    Insert into sometable values(‘A’,sysdate);
    Or
    crete new tableas follws
    crate table “somesca”.“sometable”
    har2(20) not null,
    Join_date sysdate
    Active varchar2(1) := ‘A’
    woextarea>
    <a class="eLink" title="Edit" href="javascript:popupURL('f?p=4000:371:204538675714370::::P371_ID,FB_FLOW_ID,FB_FLOW_PAGE_ID:1034609472735510,104,2');" tabindex="999"><img src="/i/e.gif" alt="Edit" class="eLink" /></a></td></tr><tr><td nowrap align="right"><label ...

    I found a good php related post that has a nice set of the potentially problematic characters (this is in the context of word pasted into IE I think). I am pretty confident that at least single curly quotes do not work well in apex 2.2). I would not be surprised if some of the others were trouble as well.:
    http://lists.evolt.org/archive/Week-of-Mon-20030602/141975.html
    here is the list
    $trans_tbl[chr(34)] = '"' ;          //      quote
              $trans_tbl[chr(38)] = '&' ;          //      ampersand
              $trans_tbl[chr(60)] = '<' ;          //      less-than
              $trans_tbl[chr(62)] = '>' ;          //      more-than
              $trans_tbl[chr(128)] = '€' ;     //      euro
              $trans_tbl[chr(129)] = '€' ;      //     euro
              $trans_tbl[chr(130)] = '‚' ;      //     low quote
              $trans_tbl[chr(131)] = 'ƒ' ;      //     florin
              $trans_tbl[chr(132)] = '„' ;      //      double low quote
              $trans_tbl[chr(133)] = '…' ;      //     ellipsis
              $trans_tbl[chr(134)] = '†' ;     //     dagger
              $trans_tbl[chr(135)] = '‡' ;      //     double dagger
              $trans_tbl[chr(136)] = 'ˆ' ;      //     circumflex
              $trans_tbl[chr(137)] = '‰' ;      //     per thousand
              $trans_tbl[chr(138)] = 'Š' ;      //     S caron
              $trans_tbl[chr(139)] = '‹' ;      //     left angle quote
              $trans_tbl[chr(140)] = 'Œ' ;      //     OE ligature
              $trans_tbl[chr(142)] = 'Ž' ;      //     Z caron
              $trans_tbl[chr(145)] = '‘' ;      //     left single quote
              $trans_tbl[chr(146)] = '’' ;      //     right single quote
              $trans_tbl[chr(147)] = '“' ;      //     left double quote
              $trans_tbl[chr(148)] = '”' ;      //     right double quote
              $trans_tbl[chr(149)] = '•' ;      //     bullet
              $trans_tbl[chr(150)] = '–' ;      //     en dash
              $trans_tbl[chr(151)] = '—' ;      //     em dash
              $trans_tbl[chr(152)] = '˜' ;      //     small tilde
              $trans_tbl[chr(153)] = '™' ;      //     trademark
              $trans_tbl[chr(154)] = 'š' ;      //     small s caron
              $trans_tbl[chr(155)] = '›' ;      //     right angle quote
              $trans_tbl[chr(156)] = 'œ' ;      //     oe ligature
              $trans_tbl[chr(158)] = 'ž' ;      //      small z caron
              $trans_tbl[chr(159)] = 'Ÿ' ;      //     Y with diaeresis
    <br>
    -Geoffrey

  • Help with Dreamweaver Validate Form Behavior

    Hello,
    I'm attempting to use Dreamweaver to validate form fields. This would work quite well except for in this case I'm using custom form code which is coming from Salesforce.com. The issue has been that the Salesforce.com web-to-lead form comes with "name" attributes on every form field item. If I change these names to make the validation look nicer, for example from first_name to First Name, then the web to lead form breaks. Is there another way to utilize Dreamweavers form validation by creating by own names for each form element instead of using "name"? The objective is to give the user something that looks good... like:
    First Name is required
    Last Name is required
    And with the Salesforce custom name fields it ends up looking like:
    900000xxxxx213s is required
    or
    last_name is required
    Thanks for any help!

    The name attribute of a form cannot contain spaces. That's why the validation behavior breaks.
    The Dreamweaver Validate Form behavior is rather crude and well past its sell-by date. Use the Spry Validation widgets instead: http://help.adobe.com/en_US/Dreamweaver/10.0_Using/WS267C8659-3AEF-4956-8268-E38CA4CAFAD3a .html.

  • Adobe X Pro Form Fields

    In Acrobat 8, I was able to justify a form field to left, center, or right and also vertically justify the field box to either top, center, or bottom.  Right now, all my form fields are vertically centered.  I want teh form field when filled to be bottom aligned to it prints on the lines of my form.
    I can't figure out the new Adobe X...the old way was much easier.   Any help?

    Text fields created in LiveCycle Designer allow that. Text fields created in Acrobat can be vertically centered or bottom aligned, but only if it's set up for rich text formatting and the user selects it. The point is you as the form creator cannot set the vertical justification for a field created in Acrobat.

  • Link form fields?

    Wow, maybe I'm just not thinking of the right terminology, but my web search fu has given me nothing. Isn't there a way to link form fields so that text that spills over from one text field will appear in a second, a la linked text frames in InDesign? I can't figure out how to do that.
    Thanks,
    Patrick

    No but you can have expanding/shrinking fields with Adobe Livecycle
    Designer bundled with Acrobat 7, 8 and 9 Pro under Windows ...
    Livecycle is more complex once you dig deeper but it has the
    capabilities for more advanced content ..
    Jon

  • How to store forms fields into the session ?

    Hi All,
    I have to store forms fields into the session.
    I have four forms (htm forms) in four jsps and there are total 25 fields.
    I am inserting all the fields into the database at once while user submit the last form.
    I want to use session to store forms fields.
    So please anybody tell me how to do that.
    Is the following code correct to store the forms fields into
    the sesstion........
    // creating a session
    HttpSession session=request.getSession(true);
    // retrieving form fields
    String name=request.getParameter("customer_name");
    String business=request.getParameter("business");
    String address=request.getParameter("address");
    and so on....
    // store form fields into the session
    session.setAttribute("name",name);
    session.setAttribute("business",business);
    session.setAttribute("address",address);
    and so on....
    and later on get the value as:
    session.getAttribute("name");
    session.getAttribute("business");
    session.getAttribute("address");
    and so on....
    OR
    is there another way to store form fields into the session.
    Please guide and reply with coding.....
    Please answer and help.
    Thanks
    Amitindia

    I don't mean to be an *** but I have no desire to help someone so unwilling to think >>and do. Go through some of these tutorial, do the examples in each and you will be far >>better equipped to ask questions:
    http://www.google.co.za/search?hl=en&q=%2Bjsp+%2Bjavabean+%2Btutorial&b >>tnG=Google+Search&meta=
    I was just asking that if I use the following
    <jsp:useBean id="cart" scope="session" class="session.Carts" />
    <jsp:setProperty name="cart" property="address" value="myaddress" />
    </jsp:useBean>then will I be able to acheive my aim as I have to store form fields into the session and later retreive while user submit the last form.
    Please read my question that I have posted.
    Am I using the right way................or which is the best way to store form fields into the session and later retrieve them.
    please reply
    Thanks
    Amitindia

  • 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

  • Making a form field that's 0.0825% of another

    I right click on the form field, hit the Calculate tab, and select the "Simplified field notation" radio button. In that I enter the following:
    this.getField('Tax').value = this.getField('Subtotal').value * .0825;
    But that doesn't work. I try this, too, figuring that maybe it automatically adds the this.getField('Tax').value part, itself:
    this.getField('Subtotal').value * .0825;
    But no such luck. The tax field never changes - it's always "1".
    Any ideas as to what I'm doing wrong or what I should be doing? Thanks!

    A few more problems. Subtotal is the sum Total 1, Total 2, Total 3, etc (via the "Value is the ... of the following fields" option). So I change "Total 1" to 10 and Subtotal is updated. Tax, however, is not and still says 0. So I change "Total 1" to 100 and now, in Tax, I see what I should have been seeing for 10.
    In other words, Subtotal * 0.0825 isn't giving me the value for the current subtotal - it's giving me the value for the last subtotal.
    Any ideas as to why?

Maybe you are looking for