Clearing NaN error from form fields.

Hey all,
Working with this script I have and I thought my condition should clear the NaN erro but it does not.  Does anyone have a clear for the NaN error that might work better.  Basicully,  all the script does is the person using it puts military time into 2 different areas.  One "On" and one "Off".  The NaN error stays in the field until they person using the form puts in the 2 times.
(function () {
    // Get the field values, as numbers
    var v1 = getField("HoursOFF1").value;
    var v2 = getField("HoursON1").value;
    var v3 = getField("HoursDif1").value;
          var time1 = v1.split(":");
          var time2 = v2.split(":");
          var min1 = time1[0]*60 + time1[1]*1 //
          var min2 = time2[0]*60 + time2[1]*1 ;
    if (v3 !== 0) {
       event.value = ((min1 - min2) / 60);
    } else {
        event.value = "";
If anyone can spot my error it would be much appreciated.  Thanks in advance!

Thanks for the help!  I still had to twik it just a little bit more.  Final code follows:
(function () {
    // Get the field values, as numbers
    var v1 = getField("HoursOFF1").value;
    var v2 = getField("HoursON1").value;
          var time1 = v1.split(":");
          var time2 = v2.split(":");
          var min1 = Number(time1[0])*60 + Number(time1[1])*1 //
          var min2 = Number(time2[0])*60 + Number(time1[1])*1 ;
    if (v1 != 0) {
       event.value = ((min1 - min2) / 60);
    } else {
        event.value = "";

Similar Messages

  • Import Text From Form Field into Subject Line of Email

    Hello,
    Is there a way to import text from a form field into the subject line of the email when sending back (attaching) the PDF form?  In other words, there is an "applicant name" and I would like that name to be the subject line of the email.
    I am using Adobe Acrobat X (10.1.7)
    If any one has aby guidance or resources online where I can locate this information I would greatly appreciate it!  I have been searching all day but have not found a solution yet. 
    Thanks!

    Thank you so much for the help.  For some reason I cannot get it to work though.   Now, when I hit the submit button it does not do anything.
    Previously, I had the following code under
    ACTIONS>Mouse Up>Submit a Form
    mailto:[email protected]?subject=Employee Application
    I removed the above mailto URL and put in your code as a Javascript function. I made sure that my field name matched the name in quotes within the code.
    I used the following:
    var subject = getField("lastname").value 
    this.mailDoc({
    bUI: false,
    cTo: "[email protected]",
    cSubject: subject,
    cMsg: "Type message here"
    Do you see anything obvious that I am doing wrong?
    Many thanks!

  • Adobe Livecycle: Save as Filename from Form Field Assistance

    I have Livecycle E2 and Adobe 9.0.  I am trying to have a pdf save in a desired location with a filename that originates from a field form.  So far, I have created a folder level script under C/programfiles/adobe/acrobat 9.0/acrobat/javascript/xxxxxxx.js.  Inside the .js folder level I have this so far:
    mySaveAs = app.trustPropagatorFunction(function(doc, path)
         app.beginPriv();
             doc.saveAs(path);
         app.endPriv();
    myTrustedSpecialTaskFunc = app.trustedFunction(function(doc, file_path)
         // Privileged and/or non-privileged code above
         app.beginPriv();
              mySaveAs(doc, file_path);
         app.endPriv();
    Also, I created a button on my pdf with a text field named "NAME".  I ran a javascript with mouseUp on the button with this code:
    // Get the field value
    var fn = getField("NAME").valueAsString;
    // Specify the folder
    var fldr = "/c/testing/";
    // Determine the full path
    var fp = fldr + fn + ".pdf";
    // Save the file
    myTrustedSpecialTaskFunc(this, fp);
    For some reason, the file does not save at all in that location after typing in some text in the name field and hitting the button.  Any assistance would be greatly appreciated!

    I have Livecycle E2 and Adobe 9.0.  I am trying to have a pdf save in a desired location with a filename that originates from a field form.  So far, I have created a folder level script under C/programfiles/adobe/acrobat 9.0/acrobat/javascript/xxxxxxx.js.  Inside the .js folder level I have this so far:
    mySaveAs = app.trustPropagatorFunction(function(doc, path)
         app.beginPriv();
             doc.saveAs(path);
         app.endPriv();
    myTrustedSpecialTaskFunc = app.trustedFunction(function(doc, file_path)
         // Privileged and/or non-privileged code above
         app.beginPriv();
              mySaveAs(doc, file_path);
         app.endPriv();
    Also, I created a button on my pdf with a text field named "NAME".  I ran a javascript with mouseUp on the button with this code:
    // Get the field value
    var fn = getField("NAME").valueAsString;
    // Specify the folder
    var fldr = "/c/testing/";
    // Determine the full path
    var fp = fldr + fn + ".pdf";
    // Save the file
    myTrustedSpecialTaskFunc(this, fp);
    For some reason, the file does not save at all in that location after typing in some text in the name field and hitting the button.  Any assistance would be greatly appreciated!

  • Bookmarks from form fields

    Is it possible to automatically create bookmarks from the text that the user types into form fields?

    In principle it's possible, but remember that bookmarks can't be added in
    Reader.

  • Auto Create Filename from Form Fields

    Hello all,
    I am trying to find a way that I can save a form with a certain filename. I have the form create and all set to go. The user will be input some information into boxes. For instance I will have a Name box and a Date box. After the user is done filling out the form I would like the filename to be these two input boxes. Is there a way to do this? So basically I need to take these two form fields and have them be saved as the filename. Any help would be great. Thanks alot.

    You can export the data form the PDF using the FormDataIntegration service.
    Once you have the data in xml format, you can use a setValue and concatenate the value of the two nodes you're interested in.
    Jasmin

  • Gather information from form fields, sort into links for searching

    I have a PDF Acrobat form that I email to about 100 people, they return the completed forms to me and I put all the forms together into a single PDF.This removes the form fields, but leaves the form information that was filled out.
    I need to set up an easy way for people to navigate and search the forms by several criteria: a person's name, their country of origin, company name, and so forth. Other than manually creating links for each of these search criteria, is there a more efficient way?

    You can export the data form the PDF using the FormDataIntegration service.
    Once you have the data in xml format, you can use a setValue and concatenate the value of the two nodes you're interested in.
    Jasmin

  • How to update session state from form field values without submitting page?

    Hi,
    I am new to Oracle APEX. I am using Oracle Apex 4.2 on Oracle 11g release 2. The problem is that when I am entering data on a form, when I enter a value in one field and move to the next field, how can I use the value of first field in the validation procedure of next field? I know that when we enter data in fields, the session state is not updated with these values until we submit the page... right... but I have seen that if there is a control of List box type, then Apex gives an option "Action When List changes" where we can choose option to update corresponding session state field with the value of list box item, without submitting the page.
    Now my questions is why this option is only available for List box items? why not for other item types like Text box, Check box,... ? can someone please help me with this?
    (the issue with update of session state depending on page submitting, is that we need a complete network round trip from client to server in order for it. However if we can update session state variables without submitting page, then we can avoid this network traffic).
    Any help will be greatly appreciated. Thanks in advance.

    Create a dynamic action on change and run a PL/SQL process there with the following code:
    BEGIN
       NULL;
    END;Page items to submit > your item.
    This will set the session state without submitting the form.
    Further examples here:
    http://apex.oracle.com/pls/apex/f?p=31517:229
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • 10gAS detecting report errors from forms

    Hi
    We are running 10g reports and forms on Red Hat.
    The forms are run using a run_report_object command to generate pdf output and then displayed using web.show_document. The parameters for the reports are entered into a form and sometimes are validated and sometimes not.
    On the whole it all works well. However, if a bad parameter is passed to a report, the report will not run and an error will be held in the report server for that report. Is there an easy way to programmatically detect in forms, that the report has errored and then to bring that error message back and display it in the form?
    TIA
    Thanks
    Tony

    Hi,
    in the past I did this with the Reports Server tables. If you install the queue table then Reports Server writes all information to the database from where you can read it
    Frank

  • Unchecking Required Field from Form Field is not working

    I am trying to un-check a field to a disable the required field function and it will not let me uncheck the box, its ghosted out. Upon filling out the form as-is > I enter text in the field as it requires and even after entering information it gives me an error and says its not filled out??!!!! I spent a lot of time on this form and do not have the time to recreate it just to risk getting the same result....

    Hi
    Did you rename the email field to Last Name? That's the only entry which will not let you uncheck this option.

  • Create dynamic directory name from form field on Sharepoint

    Trying to save pdf file to sharepoint site using URL; but need to create directory (initially) and filename dynamically. After directory created addtn'l files may populate dir, so need to check for directory exists; if so just copy files to dir based on field name. I'm able to save files to hard-coded location only, based on below.
    How to check and/or create dynamic directory base don field name?
    // folder level JavaScript to allow access to the identity object properties
    trustedIdentity = app.trustedFunction( function (sProperty)
    var iProperty = "";
    app.beginPriv();
    iProperty = identity[sProperty];
    app.endPriv();
    return iProperty;
    // folder level JavaScript to allow Save As population of file name
    mySaveAs = app.trustPropagatorFunction(function(myForm, path)
         app.beginPriv();
         var myForm = event.target;
         return rtn = myForm.saveAs(path);
         app.endPriv();
    myTrustFunct = app.trustedFunction(function(myForm, path)
         app.beginPriv();
         var vTest1 = event.target.xfa.resolveNode("topmostSubform[0].Page1[0].Test1[0]").rawValue.toString();
         var vTest2 = event.target.xfa.resolveNode("topmostSubform[0].Page1[0].Test2[0]").rawValue.toString();
         var vTest3 = event.target.xfa.resolveNode("topmostSubform[0].Page1[0].Test3[0]").rawValue.toString();
         var vTest4 = event.target.xfa.resolveNode("topmostSubform[0].Page1[0].Test4[0]").rawValue.toString();         
         var vpdf_url=location.href;location.href='http://mysite2010.com/documents
         var vPath = "/vpdf_url/" + vTest1 + Test2  + vTest3 + " .pdf";
              //console.println("vPath: " + vPath);
         var retn = mySaveAs(myForm, vPath);
         app.endPriv();
         return retn;

    Acrobat/Reader cannot create a directory. The directory needs to exist before Acrobat/Reader can save a PDF file to that directory.
    You could create a plug-in and use that plug-in to create the directory. The plug-in should also be able to determine if the directory exists or not.
    SharePoint can be tricky because it is not like most web sites. There is a special dash board that helps manage the different parts of SharePoint like list, folders, web parts, documents, etc so you may need to be aware of these features and adjust for them.
    For  folder level functions, I would not use any LiveCycle JavaScript variations. The folder level scripts are shared and accessible by Acrobat forms.

  • Acrobat XI programmatically reset/clear all form fields when opening a PDF form

    I've got a PDF form document that I'm working on.  I'd like to add something to it to programmatically clear or reset all form fields to blank when the document is opened.
    Thoughts/ideas??
    Mucho thanks!!

    You can use the resetForm JavaScript method, either in the initial page's Page Open event or in a document-level JavaScript whic will execute when the document is opened.
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.523.html

  • No Form Fields Detected - Adobe Pro X

    Hi all,
    Having a very frustrating time today and probably missing something simple.  I have created a new PDF Form and also edited a previous Form that I have used.  However, when uploading them into our software (proprietary), we get the error "No Form Fields Detected".  However, the previously edited document (the same but from previous installation of the same software - Adobe X Pro) works fine.  They are the same!
    Am I missing something here?  I get the option to Edit in Designer in my tools menu.  Checked and double checked all the fields are correct as before, no change but the two forms behave differently.  On the two versions of the previous Form, I have gone through Properties etc step by step and both Forms are identical.
    It might be that I have never done this step myself before but if I create a new form from scratch in Designer, is there a step I must do to make the Form Fields be acknowledged as Form Fields?
    Thanks in advance.
    ps. tutorials I have seen have an Edit function in the Tools menu which they use to Detect Form Fields but I only have "Edit in Designer".
    David

    Thanks for your reply.  Finally solved it last night.  Simple in the end but took ages to find it (and much hair pulling).
    My Forms were saved as Dynamic XML.   So I saved them as Static XML then reapplied Reader Extended features and it all worked fine.
    Appreciate you looking.
    Kind regards
    David

  • The form field arguments.image did not contain a file.

    Hi there,
    I'm getting a strange error with a simple file upload and I
    can't figure it out for the life of me. It's odd, because old code
    I have written before has worked fine in this area, and I really
    honestly can't see where I am going wrong.
    First the error:
    The form field arguments.image did not contain a file.
    The error occurred in
    C:\ColdFusion8\wwwroot\red_roof_rentals\components\query.cfc: line
    37
    35 :
    36 : <!---<cftry>--->
    37 : <cffile action="upload"
    accept="image/jpg,image/jpeg,image/gif" filefield="arguments.image"
    nameconflict="overwrite"
    destination="#getDirectoryFromPath(getBaseTemplatePath())#\properties\">
    38 : <cfset variables.image = "#file.ServerFile#" />
    39 : <cfset variables.thumb = "thumb_#file.ServerFile#"
    />
    I have researched this and found other people have had the
    same problem - although please be aware that I do not beleive this
    to be an issue with whatever version of CF I am running. I have
    still not found an answer.
    I have one template with my form called
    "admin_create_property.cfm". When the form posts it invokes a CFC
    method that uploads the file and inserts stuff into the database.
    However, it dies at the file upload part with that bizzarre error.
    There are only two files working in this:
    admin_create_property.cfm
    query.cfc
    I will write the code out for these so you can see. Please
    see attached code. Please note that I have taken out as much
    irrelevant code as possible (html, doctypes etc etc).
    Any help with this would be greatly appreciated as I am
    absolutley stumped to be quite honest. I've heard people say it
    could be any of the following:
    1 - Need to use enctype="multipart/form-data" - which I DO
    2 - cffile filefield can't contain ## - which it DOESN'T
    3 - Inut type must be file - which it clearly is.
    Please please help, I feel stupid asking about this but I
    need you guys more than ever!
    Kind regards and thanks in advance,
    Mikey.

    I don't get what you mean as this is what I am doing.
    <cfinvokeargument name="image" value="#form.image#" />
    This takes the value of the image file field and passes it to
    the CFC as an argument.
    Am I doing something wrong with this? Sorry for my
    stupidness!
    Thanks for you help, further assistance would be greatly
    appreciated.
    EDIT: Interestingly enough, if I just use the tag on my
    "admin_create_property.cfm" page instead of using the CFC method
    like this...
    <cffile action="upload"
    accept="image/jpg,image/jpeg,image/gif" filefield="form.image"
    nameconflict="overwrite"
    destination="#getDirectoryFromPath(getBaseTemplatePath())#\properties\">
    It seems to upload the image just fine. Why then would this
    not work if all I am doing is simply passing to the CFC the value
    of the "form.image" as an argument so that the file upload can
    happen in my CFC instead of in the calling template??!
    It's really bizzarre.
    Mikey.

  • How to clear a master detail form in adf

    hi
    I am using j developer 11 g (ADF). I have a master detail page. i want to clear all data when the form loading first time
    I used an lov for searcching the data. here am called createInsert method for clearing the data from form on
    pageload, but am going for searching the data for the first time the searched data are inserted in to database
    as a new record . How i rectify this problem. Ultimate my aim is to clear the date when the page is loading first time
    I also try with the following code also
    String amDef = "model.masters.MastersAM";
    String config = "MastersAMLocal";
    ApplicationModule am = null;
    am = Configuration.createRootApplicationModule(amDef, config);
    ViewObject vo = am.findViewObject("TestCaseNewVO");
    // vo.setWhereClause("Id=0");
    //vo.executeQuery();
    vo.clearCache();
    Regards
    Rajesh
    Edited by: [email protected] on Apr 29, 2009 10:34 PM
    Edited by: [email protected] on Apr 29, 2009 10:35 PM

    Hi Chan Kelwin
    I tried with ur code. But in the form loading first time the form controls are not cleared
    i write the code in my page load. I take the query from view object runtime. it also
    working fine but that is not reflected on the form. i used to drag and drop the detail view
    and used to master-detail option for binding in the form. But still i have the same problem
    i used the following code
    @PostConstruct
    protected void OnLoad() {
    if (!isPostback()) {
    // CreateNewRecord();
    FacesContext fctx = FacesContext.getCurrentInstance();
    ValueBinding vb =
    fctx.getApplication().createValueBinding("#{bindings.TestCaseNewVOIterator}");
    DCIteratorBinding userView = (DCIteratorBinding)vb.getValue(fctx);
    String amDef = "model.masters.MastersAM";
    String config = "MastersAMLocal";
    ApplicationModule am = null;
    am = Configuration.createRootApplicationModule(amDef, config);
    ViewObject vo = am.findViewObject("TestCaseNewVO");
    ViewCriteria vc = vo.createViewCriteria();
    ViewCriteriaRow vcr = vc.createViewCriteriaRow();
    vcr.setAttribute("Tid", "IS NULL");
    vc.add(vcr);
    vo.applyViewCriteria(vc);
    System.out.println(vo.getQuery());
    vo.executeQuery();
    }

  • Passing parameters to reports from forms.

    Hi
    we are using developer suite 10g and developed some applications.Our reports are working from report buider and also from the forms when we are not passing any parameter.
    But when we add the clause to pass the parameter from forms fields it does not show any values and we get a blank report.
    when we use this code it works with default value set in the report
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no');
    But when we use code to pass the parameter like this it does not work
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'EMPLOYEE_TICKET_NO='||lpad(ltrim(:hris_employee.em_ticket_no),5,' ')||'paramform=no');
    Please suggest how to pass parameter values from forms.
    Thanks in advance

    Hi Ansu
    In your code set paramform ='Yes' .Then run report ,it will show you the values that are passing through parameters.SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=yes');
    If it doesnt work for you.
    Try this code
    declare
         pi_id paramlist;
    begin
         pi_id := get_parameter_list('item_param');
    if not Id_null(pi_id) then
         destroy_parameter_list(pi_id);
         end if;
    pi_id := create_parameter_list('item_param');
    add_parameter(pi_id,'PARAMFORM',TEXT_PARAMETER,'no');
    /**********Add here your parameters***************/
    add_parameter(pi_id,*'report parameter name'*,TEXT_PARAMETER,*value from form*);
    RUN_PRODUCT(REPORTS,'c:\MAKESS\INVENT\REPORTS\add_mat_req.RDF',SYNCHRONOUS,RUNTIME,FILESYSTEM,
    pi_id,NULL);
    --Ajay Sharma                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for