Script for Required fields acting strange on extra spaces at end of Name/Description

Found this script on this forum, which I added to my submit button.
var emptyFields = [];
for (var i=0; i<this.numFields; i++) {
     var f= this.getField(this.getNthFieldName(i));
     if (f.type!="button" && f.required ) {
          if ((f.type=="text" && f.value=="") || (f.type=="checkbox" && f.value=="Off")) emptyFields.push(f.name);
if (emptyFields.length>0) {
     app.alert("Error! You must fill in the following fields:\n" + emptyFields.join("\n"));
Great script but the ERROR! popup was not coming up until I went into InDesign and removed extra spaces after "(g)" Description and Names.
I am new at this, can someone let me know of any rules for naming these fields such as using underscores, or any other illegal chacters.

Jeff,
The SQL in the script file is below.  To be honest, I have reduced it down to a simple select from dual and it still puts extra spaces at the end of the single line.
col ord noprint
spool test.csv
SELECT  ' ' ord,
  'ZONE_ORDER_NUMBER'||','||
  'ZONE_NAME'||','||
  'ZONE_TYPE'||','||
  'DESCRIPTION'||','||
  'START_DATE'||','||
  'END_DATE'
FROM dual
UNION ALL
SELECT zone_name ord,
  '"'||zone_order_number||'"'||','||
  '"'||zone_name||'"'||','||
  '"'||zone_type||'"'||','||
  '"'||description||'"'||','||
  '"'||TO_CHAR(start_date,'DD-MON-YY')||'"'||','||
  '"'||TO_CHAR(end_date,'DD-MON-YY')||'"'
FROM zones
ORDER BY ord;
spool off

Similar Messages

  • Check for required fields before locking subforms and submitting

    Hello,
    I have a 5-page form with many questions, to be completed by the original requestor and multiple approvers.  What I'm trying to do is have the original requestor's Submit button on p. 3 lock the input on the first three pages, but first check if all those fields have some content.  I currently have all the fields on pp. 1-3 set to "Required" in the object properties, but my script still locks them when there's is one empty one.  Here's what I have:
    //Lock portions of form
    Page1.access = "readOnly"
    Page2.access = "readOnly"
    Page3.access = "readOnly"
    //Save document, allow user to change name
    app.execMenuItem("SaveAs");
    //Submit via e-mail
    Submit_REAL.event__click.submit.target = "mailto:[email protected]" +
    "?subject=Subject text" +
    "&body=Message";
    Submit_REAL.execEvent("click");
    The automatic check for required fields happens after the pages get locked.  I would like the check to stop the process before it locks the pages.  Is there any way to check all at once that all "Required" fields on those pages have some content before allowing the script to proceed?  I know how to script it to manually check the 50 or so questions on those pages, but I would like to avoid that.  Thanks for any help.

    There are a few problems that I can see from the start. First, your code is going to pick up EVERY node that exists on these pages. Some of those nodes will not have a rawValue, and some will not have an actual name. As an example, you can take your code and create a text field to dump all of the names of the nodes that you get when you pull in all of the nodes this way. Here's an example:
    The result:
    Now, the question is, do you have a consistent naming convention for your fields that might be empty? That could be text fields, radio button lists, etc. For instance, I always prefix the names of objects in order to more easily keep track of what they are in scripts. Since I'm doing that, I can check the name of the field for tf, nf, rbl, cb, or whatever I have included to make sure that I'm checking an actual field before I check for things like rawValue.
    var nodeName = oNodes.item(nNodeCount).name;
    if (nodeName.indexOf("tf")>-1 || nodeName.indexOf("rbl") > -1 || /*check other field types*/) {
      //insert your code to check for empty answers here
    As for your line 7 issue. The syntax problem is that you've put extra parentheses in your if statement. Take out the parentheses that are just before and after the or "||".
    *This is my fourth attempt to reply. Something was going on with Adobe/Jive earlier, I suppose.

  • How to show asterisk for required fields in a table row?

    Hi Folks,
    For showing the asterisk (*) for required fields in a form, I used to give required="true" for the component and surround the component with a af:panelLabelAndMessage for which I set showRequired="true". How to do this for a component in a table row. For a component in a table, there is no label per se. The required=true flag in the component shows proper error message saying that it is required but there is no (*) for that component.
    Thanks
    Vishal

    Table does not have any required attribute.But column has showRequired property .You can used this.If column has input text then also you put required true on this component.And set your required messages there .
    It will resolve your problem
    Thanks
    Prateek

  • Scripting for Required Contingent Questions?

    I have a form with a table, and depending on the answer selected in the left-most column, which is a dropdown menu, fields in the will become required.  Sounds confusing when I read this, but what I mean is if someone selects YES from the dropdown menu for rows1 and 2 and NO for 3-6, then the rest of the fields in rows 1 and 2 become required and text has to be added or dropdown menus have to have a valid answer selected while the rest of the table does not.
    The table looks like this:
      Order book?    Author  Title    ISBN\Publisher    Total Requested  Readopt?   Required?
      (Dropdown Y/N)  (Text)   (Text)  (2 Sep. Text Fields)   (Text)     (Dropdown) (Dropdown)
    1.
    2.
    3.
    4.
    5.
    6.
    The answers become required in the sense that they have to be filled out before the form can be submitted, and not in the sense that one answer can only be filled in if the previous is answered.  It might be too much for the people filling out the form to have to make sure the previous field is entered before moving on to the next one.  The entire table is visible already, so I don't need the fields to become visible upon selecting YES, although I see the benefit in this too.  Can I have the scripting formulas for both, like, can I make the fields become visible upon selecting YES (so text can't be entered if they select no) and required to fill in before submitting?
    Oh, another thing I'd like to do is make 1 selection from a dropdown menu not valid.  I have a list of **, YES, and NO.  I want to make the ** not recognized as a valid response.  Thanks for your time and patience.  I realize this question probably belongs in the Scripting forum, so I'll add it there too.

    If you use a field naming convention that places a row identifier at the beginning of the field name, you can do what you want with a single statement in the Validate event of the column 1 combo box. For example, if the field names for the row are:
    row1.author, row1.title, row1.isbn, row1.publisher, row1.total, row1.readopt, row1.required
    The following code can be used as the combo box's Validate script:
    // Validate script for the column 1 combo box
    getField("row1").required = (event.value !== "**");
    Set up the combo box options so that "Commit selected value immediately" is selected.
    You can then use a similar script for the other combo boxes in the other rows. If you stick to the row1, row2, row3, naming convention, you can create a single document-level function that can be called from all of the combo boxes:
    function setRequired() {
        // Get the row ID, which is the fourth character of the field name that called this function
        var num = event.target.name[3];
        // Set the required property of the other fields on the row
        getField("row" + num).required = (event.value !== "**");
    and call this function like this in the combo box's Validate event:
    // Validate script for the column 1 combo box
    setRequired();
    The problem is setting the required value of a combo box (readopt, required), since a combo box always has a non-blank value, unlike a text field. So a better way to handle this is to create a script that scans all the fields in all the rows and checks for completeness. This allows you to create a more user friendly error message and can handle required combo boxes. Post again if you need more help with this approach.

  • * is missing for required field in error message

    Hi all,
    I am using JDeveloper 11.1.1.2 with ADF BC. I have a simple form in a jspx with some fields for user to input.
    The page contains 3 mandatory fields (simply set required=true): Surname, Name and Title. Where Surename and Name are inputText, and Title is a Select One Choice with List Of Value defined in VO.
    If user submit data without anything in the required fields, an error message will popup. But the content of the error message is not quite correct!
    All the required inputText has a prefix: *, but Select One Choice do not have a leading *.
    Error
    Messages for this page are listed below.
      * Surname  You must enter a value!
      * Name     You must enter a value!
      Title      You must enter a value! is there anyway to add a * to the error message for Select One Choice? or remove all the *? It looks very confusing.
    Thanks in advanced,
    Samson Fu

    not sure,
    but try to set the ShowRequired for this LOV in property inspector to true

  • Form Features: Checking for required fields on scrolling or moving to the next page.

    Hi! I am developing a form which will be distributed to people using Adobe Reader without the JavaScript functionality. I have a form with about 20+ pages and each page has 4 required fields. I would like to make it easy for the users to show the errors then and there when they miss a require field, instead of having a generic "required field not filled" message at the end of the document. How do I do this without JavaScript? It would be better if the document jumps to the page where there is an empty "required" field.

    This isn't possible without using JavaScript.

  • Strange problem - Extra space coming before period.

    I have a strange problem with CR 2008 SP2. I tried in SP3 also . Same problem exists.
    Consider a text like "Configuration.". If I add this text in designer and use a preview is shows like "Configuration.". But when I run the report , it displays like "Configuration  .".  Note the extra spaces coming before period. I am using win xp . And using win form application. The font used Times New Roman. This issue is common to any text shown in report. Where ever a period is displayed , extra space is coming . How to solve this issue.

    There is an "fix" which has been intentionally not documented in release notes as itu2019s a new hidden API added in XIR2 SP4 and XI3.1 that could cause problems with rendering of other fields.  To activate the fix, a configuration file has to be added to the project, called "app.config" (.NET 2.0) and it contains the following information. Then rebuild the solution. Please test thoroughly...
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <configSections>
        <sectionGroup name="businessObjects">
          <sectionGroup name="crystalReports">
            <section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler"/>
          </sectionGroup>
        </sectionGroup>
      </configSections>
      <businessObjects>
        <crystalReports>
          <crystalReportViewer>
            <add key="AntiAlias" value="true"/>
          </crystalReportViewer>
        </crystalReports>
      </businessObjects>
    </configuration>
    Ludek

  • Value for customized fields didn't get copied to back end system

    Hi,
    We are in SRM 4.0 and using extended classic scenario.
    We have defined two customized fields in account assignment tab in shopping cart and SRM Po and also in back end PO.
    SRM POs are having values for the field but while transferring the Po details to back end system, for some of the line items of the Po the entries are missing in back end system.
    Problem is only with few line items of the PO.
    Have tried with FM like BBP_PD_PO_TRANSFER_EXEC  and BBP_PD_SC_RESUBMIT, but it is not transfering the values to back end.
    Is there any other way to push the missing values to back end system.
    Please advise.
    Thanks.

    Sk,
    Table adjustment has to be done accordingly. Get in touch with your Basis team.
    Thanks.

  • Extra space in end of line constant

    Hello All,
    Does anyone have an explanation why when using an end of line constant and a format into string there is an "apparent" extra space included?
    The attached VI (LV 8.5) shows the behaviour. There should not be a space after the "e", but there appears to be. If you view the string in hex form there is clearly not an extra space character. What is going on here, am I misinterpreting how this is supposed to work?
    nrp
    CLA
    Attachments:
    odd.vi ‏7 KB

    Hi nrp,
    Man I was trigger happy.
    I see what you mean, if you step through the 'normal' string you will notice their's a position after the 'e' before going to the next lin.
    This was my original reply (humble, humble)
    I don't really get what you mean but I think you need to remember the 'hex' view is a formatted view, with an additional space after every second character!
    The function returns this for me:
    Which is totally acceptable for me. I see 5 characters ('o','n','e','CR','LF')
    Ton
    Message Edited by TonP on 12-27-2007 04:47 PM
    Message Edited by TonP on 12-27-2007 04:49 PM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    odd-1_BD.png ‏1 KB

  • Script for Checkboxes & Fields

    Hi Friends - I have a question that has been bother me for awhile...
    Can you write a script that says "If checkbox A is checked & checkbox B is unchecked, then field C is visible & field D is hidden"?
    I've tried several times unsuccefully to get a script to do this. I appreciate the help!
    P.S. I'm using Adobe Pro XI

    Yes you can, but the specific script and the best place to put it depend a bit on what type of fields C and D are. It also depends on what should happen if both A and B are checked or unchecked, or A is checked and B is unchecked. In other words, what should happen for each possible combination of A and B?

  • Creating a script for Date Field

    Hello,
    I am new to Adobe Live Cycle and I am struggling with creating an action that will populate multiple fields.
    Example
    I have a Report Date 1FEB and 3 FEB End Date
    Day 1 1FEB
    Day 2 2FEB
    Day 3 3FEB
    I would like the user to be able to select the report date and day 1, 2, 3 etc will auto populate with the report date +1+2+3

    So I figured it out on my own.  Posting for anybody that might be looking for the same thing..
    Table1[0].Row1[0].Date1.rawValue = Num2date(Date2Num(Date1.formattedValue, "MMM D, YYYY") +0, "MMM D, YYYY")
    Table1[1].Row1[0].Date2.rawValue = Num2date(Date2Num(Date1.formattedValue, "MMM D, YYYY") +1, "MMM D, YYYY")
    Table1[2].Row1[0].Date3.rawValue = Num2date(Date2Num(Date1.formattedValue, "MMM D, YYYY") +2, "MMM D, YYYY")
    Table1[3].Row1[0].Date4.rawValue = Num2date(Date2Num(Date1.formattedValue, "MMM D, YYYY") +3, "MMM D, YYYY")
    Table1[4].Row1[0].Date5.rawValue = Num2date(Date2Num(Date1.formattedValue, "MMM D, YYYY") +4, "MMM D, YYYY")
    Table1[5].Row1[0].Date6.rawValue = Num2date(Date2Num(Date1.formattedValue, "MMM D, YYYY") +5, "MMM D, YYYY")
    Table1[6].Row1[0].Date7.rawValue = Num2date(Date2Num(Date1.formattedValue, "MMM D, YYYY") +6, "MMM D, YYYY")

  • Created a form in Forms Central. Exported the PDF with Submit Button Option. When the PDF is filled out and submit clicked, it comes back asking for required fields to be filled but they already are. Any Help?

    b

    Hi;
    OK - I can clarify some things and tell you how to do what your looking for. 
    The desktop FormsCentral application tools are really designed towards create forms that do collect data on FormsCentral servers.  You can still easily create PDFs that do not submit data to FormsCentral, but you'll have to add any alternative submit functionality using the Forms tools in Acrobat.  You can create a PDF without the submit button in either case, signed in/out of the Desktop Application from the "File" - "Save as PDF Form" menu item.  You can then modify the PDF in Acrobat XI Pro by doing a "Save A Copy", when you open the copy you can edit it any way you like, adding a "Submit" button that email's the PDF/Responses back to you...
    Here's how: In Acrobat open the PDF you saved from the FormsCentral Desktop application and go to "File" - "Save a Copy" and choose a location, this will remove the security.  Open up the copy you just created and you can now edit it, here is a YouTube video tutorial using Acrobat XI, he covers the email button in about two minutes, there are lots of tutorials out there but this one is easy to follow:,
    http://www.youtube.com/watch?v=Jql1wp5Gofs
    Thanks,
    Josh Corey
    FormsCentral Team

  • Validation for text field: Null and contains no spaces

    Currently on APEX 3.2
    I want to check 1 text field and 2 text areas to ensure they are not null and blank (hitting the space bar in the field) before submitting the page. How do I do both validations for on each field?

    I created a validation with a type of 'Function Returning Boolean' and using the following code in the expression:
    IF( TRIM( :P1_Text_Field) IS NULL
    Or LTRIM( :P1_Text_Field ) != :P1_Text_Field )
    THEN
    RETURN false;
    ELSE
    RETURN true;
    END IF;
    Edited by: Jeremy_F on Apr 12, 2012 8:15 AM

  • Position keyframes for titles not acting properly; keep moving backwards near end keyframe

    I have no clue what in teh world is going on here. i will set a keyframe in the beginning for the titles initial start point. Move ahead 2 seconds. Set a keyframe. Move the title to where I want it. Play it back, and then right before the end keyframe, the title will go the complete opposite direction if I have another keyframe ahead of it I want it to go to. So yeah, it moves back then moves forwards to the next keyframe. Please help me understand this lunacy.

    Having recently encountered this issue, I searched the web for a solution and stumbled upon this thread, which to my surprise was not only left unanswered, but also seemed to be the only search result that was directly relevant to my problem.  Luckily, I was able to adapt some advice from a similar situation.  Since I finally discovered a solid method, I figured I would offer my knowledge to anyone else treading the same path as me.
    I guess they call something like this a "wobbly" keyframe.   In After Effects, someone gave the advice to right click and change the temporal interpolation to LINEAR.  In premiere, I noticed that they were ALREADY linear, but then I recalled Shooternz post about a spatial ease.
    Highlight ALL the keyframes, right click, then select Spatial Interpolation and click on Linear.  This should solve the issue.  You can then add eases and such to meet your goals.
    I knew from the beginning that it must have been an invisible knot in the bezier curves.  I pulled the bars in every direction, but all it did was tighten or loosen the knot, causing the motion to speed up or slow down, but it would always hit the knot and reverse before continuing forward. You know how Illustrator will create crazy-looking lines when you try to add too many points with strong curves?  Well the same logic applies to this, but Premiere has a much more difficult interface when dealing with bezier curves.  In other words, by getting rid of the extra curves instead of trying to fix them like you can in Illustrator, it fixes the problem much more easily.
    I hope I helped to clarify the issue and help you understand the logic of what went wrong, so you can move on now and perhaps adapt this knowledge to future obstacles.

  • Adobe forms-checking that required fields are completed-Java Script

    I have inserted two Java Scripts into my form--one for checking for required fields are completed, and then one for generating an email pulling a custom subject line, as shown below:
    var emptyFields = [];
    for (var i=0; i<this.numFields; i++) {
         var f= this.getField(this.getNthFieldName(i));
         if (f.type!="button" && f.required && f.display==display.visible) {
              if ((f.type=="text" && f.value=="") || (f.type=="checkbox" && f.value=="Off")) emptyFields.push(f.name);
    if (emptyFields.length>0) {
         app.alert("Error! You must fill in the following fields:\n" + emptyFields.join("\n"));
    this.mailDoc({bUI:false,cTo:"[email protected],[email protected],[email protected]",cSubject:"Bugzilla Form for: "+this.getField("Bugzilla Title").value+" - "+this.getField("Bugzilla ID").value})
    Issue: After the error window displays fields that have not been completed, when I click OK the email window displays.
    QUESTION: How can I stop the email window from displaying until all fields are completed?
    THANKS!

    Thank you so much for your quick response (and thank you for all the code that I am reusing!) I have another issue now.Can you see why the following is occurring....
    I placed else in and now it edits the required fields, but once they are completed, will not initiate the email prompt. Here's what I have now
    var emptyFields = [];
    for (var i=0; i<this.numFields; i++) {
         var f= this.getField(this.getNthFieldName(i));
         if (f.type!="button" && f.required && f.display==display.visible) {
              if ((f.type=="text" && f.value=="") || (f.type=="checkbox" && f.value=="Off")) emptyFields.push(f.name);
    if (emptyFields.length>0) {
         app.alert("Error! You must fill in the following fields:\n" + emptyFields.join("\n"));
    elsethis.mailDoc({bUI:false,cTo:"[email protected],[email protected],[email protected]",cSubject:"Bugzilla Form for: "+this.getField("Bugzilla Title").value+" - "+this.getField("Bugzilla ID").value})

Maybe you are looking for

  • I miss the old Homesite

    I'm in a bit of a delima. I have used an old version of Homesite for some time now. It was the version that would allow the three views; edit, preview, and the editable WUSIWYG screen. As I'm sure all of you know, this version will no longer work wit

  • SQl Error while executing query in BEx

    Hi All, We are executing a Report in Bex 7.0 and we get the selection screen once i give the slections and execute it after running for few mins ( say 3 mins), its giving the below error message. Error Sql: 1578 Error ORA-01578 ORACLe DATA BLOCK Corr

  • Transfer boot camp, parallels, windows to internal drive

    My 2011 MBP crashed for the 4th time (bad graphics chips), so I was given a new MBP.  They nicely kept the old machine and transferred the HD info over to the new one. However, they did not transfer any of the boot camp/windows/parallels stuff.  I ha

  • The 'Click' camera sound when taking a picture

    is there any way to turn the sound off so that you can take a picture without the annoying 'camera' shutter sound? Thanks!

  • N82 - problem with GPS navigation

    I loaded all necessary Nokia maps, and have problem. Everything is working fine, options "route to/from" is working, simulation also, but when order "start navigation", program immediately shutdown. Is this problem familiar to anyone? Any experience