Fill in the time field, based on the checkbox

I am trying to find a script to do the following:

If checkfield.rawValue = "1" (checked)

timefield.rawValue = (current time)

If checkfield.rawValue = "0" (unchecked)

timefield.rawValue = 'null '.

Any ideas or suggestions would be greatly appreciated.

Thank you.

Here's a modified version. Display BBS of the script added additional characters that mess. I moved the code to the change event of the box (I think it's nicer whne the user clicks to see the change rather than leave the checkbox). Validate the e Th message was because you had a pattern on the ground and time resulting does not match. I deleted the template as well as disable the validation script message.

Paul

Tags: Adobe LiveCycle

Similar Questions

  • How do fill you a text field based on the entries in other text fields?

    I would like to be able to have a text field that fills as 'Full' or 'Incomplete' based on the question if all required fields have been filled or not.

    For example, if the "First Name", "Last Name" and "City" text fields are not filled, the text of "the State of completion" field displays 'Incomplete' and once they are filled, the text of "the State of completion" field will turn into "Complete".

    How can I do this using javascript? I searched the web for a tutorial, but most of the results seems to be focused on the menu drop-down.

    Please point me in the right direction!

    Try the script below. I put this on the calculate for Field1 event

    If (FirstName.rawValue == null |) LastName.rawValue == null | City.rawValue == null) {}

    Field1.RawValue = "incomplete."

    }

    on the other

    Field1.RawValue = "complete."

  • Auto-fill text box values field based on the selection of the menu drop-down

    Try to fill in address, city, province, zip from text fields based on the selected option in a select form field. The following code works fine in Internet Explorer, but in Chrome or Firefox, after selection, text, the fields are filled with the word "undefined."

    I found a PHP script Jquery here version that would probabably do the trick.
    http://StackOverflow.com/questions/3657127/jQuery-populate-text-input-from-table-based-on-select-Valeur

    Maybe someone has a version of CF. they could share?

    Thanks in advance to anyone who can point me to a solution for this code, or a better way to fulfill my need.

    <!--> destinations with address auto-fill, city, etc.
    < script type = "text/javascript" >
    function selectAddress (list) {}
    take the first element is empty
    If (list.selectedIndex > 0) {}
    var locationID = list.options [list.selectedIndex] .value;
    locationAddress var = list.options [list.selectedIndex] .locationAddress;
    var locationCity = list.options [list.selectedIndex] .locationCity;
    var locationState = list.options [list.selectedIndex] .locationState;
    var locationZip = list.options [list.selectedIndex] .locationZip;
    document.getElementById('locationID').value = locationID;
    document.getElementById('locationAddress').value = locationAddress;
    document.getElementById('locationCity').value = locationCity;
    document.getElementById('locationState').value = locationState;
    document.getElementById('locationZip').value = locationZip;
    }
    }
    < /script >
    < b >
    < td align = 'right' bgcolor = "#FFFFFF" valign = "top" > Destination name < table >
    < td align = "left" bgcolor = "#FFFFFF" valign = "top" >
    < select name = "locationID" onChange = "selectAddress (this)" class = "smallforms" > "
    < option value = "" > SELECT the DESTINATION ››› < / option >
    < cfoutput query = "allLocations" >
    "" < option value = "" #locationName # "locationAddress =" #allLocations.locationAddress # "locationCity =" "#allLocations.locationCity #" locationState = "#allLocations.locationState #" locationZip = "#allLocations.locationZip #" > #locationName # < / option >
    < / cfoutput >
    < / select >

    Others: cfinput name = "destinationNameOther" type = "text" class = "smallforms" size = "75" >
    < br / >
    < input id = "locationID" name = "locationID" type = "hidden" > < br >

    Address: < input class = "smallforms" id = "locationAddress" name = "locationAddress" type = "text" size = "30" >
    City: < input class = "smallforms" id = "locationCity" name = "locationCity" type = "text" size = "20" >
    State: < input class = "smallforms" id = "locationState" name = "locationState" type = "text" size = "2" >
    Postal code: < input class = "smallforms" id = "locationZip" name = "locationZip" type = "text" size = "8" > < br / >
    < br / >
    < table > < /tr >

    In your last code done selectAddress refers to "index" but I'm not declared or assigned. I think that you are missing 'var index = list.selectedIndex;' statement.

  • How to set a value in a numeric field based on a checkbox field?

    I try to get a numeric field to return to a certain numerical value according to the response from the user for a checkbox control. Here is my code:

    If (CheckBox1 .rawValue [0] == 1) then $.rawValue == 969.00 else $.rawValue == "" endif

    When the form is displayed, the value of the numeric field poster in the form $1,00 and if I check the box it changes $ 0.00 - but I want him back $969,00 if checked and be empty when not checked.

    Can someone help me understand this?

    Hello

    FormCalc syntax, so make sure that you have set the language in the script in FormCalc Editor.

    Also, you are right when you test equal to use the double equal sign ==. However, when you set a value, you use a single equal sign.

    FormCalc does not need the .rawValue.

    Make sure you have set the 'specify values' tab of object/link check box and on = 1. [0] in your script also indicates that there is more than one occurrence of CheckBox1. I'd be inclined to objects of unique name, as it makes it easier to script.

    So it should work in the case of calculating the numeric field:

    if (CheckBox1 == 1) then
         $ = 969.00
    else
         $ = 0.00
    endif
    

    Configures the model of the numeric field for monetary symbols, etc.

    Good luck

    Niall

    PS you can put figs in quotes. Also having the calculate event script will automatically make the calculated - read only field. You can, but if you do not you can change it in the tab/value of the object. On the other hand, you can have a script similar to the output of the box event.

  • How the auto fill a field based on the drop-down list unless the specific item is selected

    Hi all

    My apologies if I posted this in in the wrong place, but I am new to these forums, JavaScript and Adobe LiveCycle.

    I am trying to build a form using LiveCycle Acrobat but have problems with the drop-down lists.

    Inititaly I just wanted to fill in the fields in a table based on a matching menu selection dropdown in another table.

    I used the following code and it worked fine:

    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)

    fFrom var = xfa.resolveNodes ("Workbook.Content.Table1.Row3.AppropriationDetails [*]. Row4.cell1');

    OTF var = xfa.resolveNodes ("Workbook.Content.Table2.Row3.AppropriationDetails [*]. Row4.cell1");

    for (var i = 0; i < = fFrom.length - 1; i ++) {}

    fTo.item (i) .rawValue = fFrom.item (i) .boundItem (xfa.event.newText);

    }

    The problem is that now I want the code above works UNLESS one of the items in the drop-down list is enabled specifically in this case, I want the text box in the other table to display a message such as "Details of the entry in the field below.

    I tried to create an If Else statement using the following code:

    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)

    fFrom var = xfa.resolveNodes ("Workbook.Content.Table1.Row3.AppropriationDetails [*]. Row4.cell1');

    OTF var = xfa.resolveNodes ("Workbook.Content.Table2.Row3.AppropriationDetails [*]. Row4.cell1");

    for (var i = 0; i < = fFrom.length - 1; i ++) {}

    If (fFrom.item (i) .rawvalue = "Option 3") {}

    fTo.item (i) .rawValue = "enter the details in the field below.

    }

    else {}

    fTo.item (i) .rawValue = fFrom.item (i) .boundItem (xfa.event.newText);

    }

    }

    The code now filled the field with "Enter the details in the field below" any item I select in the drop-down list.

    Your help is greatly appreciated.

    See you soon,.

    ozzy_q

    Hello

    You use .rawValue in the change event. This will cause problems because the selection of the users has not received .rawValue from the drop-down list at the time when the change event is triggered.

    Move your script as it should to the output of the dropdown event.

    Hope that helps,

    Niall

  • Fill in the field of text based on the menu drop down.

    Here's the scenario: I have 2 drop-down lists on page 1 (list1, List2). Based on this selection, I want to fill in a text field on page 2 with their values, after clicking on a button to update at the bottom of page 2. I use the button click event, but how can I get the actual values of each drop-down list on the previous page?

    You must give the full path to the objects (i.e. form1. Page1.DDListName.RawValue). look in the view hierarchy to see the structure you want. Conversely, you can place the cursor in the script editor where you want the reference to appear, hold done the key ctrl and move the mouse to the object you wish to reference (it will change into a V). Then click on the mouse and the appropriate for this object reference is displayed in the script editor.

    Paul

  • Fill in the multiple fields based on the checkbox

    (other questions newb...)

    You want to fill several form fields from or not a checkbox is enabled.

    I now using scripts calculated in the work field. for example:

    If (this.getField("checkbox").value == "Off") {}

    Event.Value = null;

    } else {}

    Event.Value = "ABCXYZ";

    }

    However, it is possible to assign values only from the field box itself?

    Yes, you can do so from the MouseUp event of the checkbox field. It will look something like this:

    if (event.target.value=="Off") {
        this.getField("Text1").value = "";
        this.getField("Text2").value = "":
    } else {
        this.getField("Text1").value = "ABCXYZ";
        this.getField("Text2").value = "123456":
    }
    
  • linking two fields and fill in the two field based on the list drop-down selection box 1

    I work for a small social service agency VERY small non-profit and I try to get our paperwork until the twentieth century. I hope someone here can help me. I have adobe acrobat, but not of other adobe products. I converted our word document that we use for client notes in fillable pdf format and so far everyone is excited to try it. I have a huge problem that I can't understand. I have a customer named created drop-down list box that contains a list of 300 customers. Box 2 is named customer ID and will contain a unique identification code assigned to each customer.

    For example:

    CUSTOMER ID customer JANE DOE 12345678

    So here is my question how can I ensure that when Unetelle is selected 12345678 is already filled in the second field?

    I fill the drop-down list with the names of customer and then enter the customer ID as the value of exports. Note You must have a unique name for each client.

    If your customer ID starts at zero, then you must use a custom JavaScript, so you can keep the zero non significant.

    For the customer ID field, you can use the following custom JavaScript code:

    Event.Value = this.getField("DropBoxFieldName').valueAsString;

    You will need to change DropBoxFieldName name of the drop-down list.

    You will need a mechanism for updating the new customer form and IDs names.

  • Fill in the Date field to CurrentDate if not entered by the user

    I have this simple condition to enter the Date to current date if it is not entered by the user. In the same way with the time of day. I tried writing below the lines in the document of the rule, but it does not work: -.

    DATE = current date if

    DATE is not known

    Can someone help me with this? I have a screen where the field belongs to several questions. If not entered by the user, the system fills when the user presses the submit button.

    3 things to consider:

    • If the user does not provide an answer to a question of date attribute, this attribute date will be uncertain, not unknown;
    • You cannot define an attribute based on itself - which is a loop of logic and modules does not compile
    • You cannot set a conditionally non Boolean attribute without a rules table.

    My solution would be to ask the user for the value of another attribute (DATE of the USER) and then use it to determine the value of DATE inside a table of rules, as follows:

    DATE

    the date of the day

    The USER DATE is uncertain

    THE USER DATE

    in the opposite case

    See you soon,.

    Brad.

  • Hide/show the fields based on textbox

    I wonder if there is a way to hide certain fields based on the question of if a user enters a value in a text box and then reappear if the value in the text box is removed and the field becomes white.

    I have two scenarios where I would this happen

    1. I have a "Non-registered" check box and a text field 'blood pressure '. If the user check mark the box "Not registered", the field of blood pressure is hidden (I managed this already). If the user unclicks the box, the field of blood pressure again (even once, I did already). Otherwise, if the user enters a value in the 'pressure' I would 'Unregistered' area to disappear. I got this as well with this code: (placed in the form of javascript Action, mouse upward, event)

    this.getField("Not_Recorded").display = event.target.value = "Off"? Display.visible: display.hidden;

    I don't know if it's the appropriate script that I use, but he did not hide the field "unregistered". The problem is, I would 'not registered' to hide if a value is entered in the field of blood pressure and reappear if this value is then removed (i.e., the user changes his mind or made a mistake and wants to not click saved instead). I don't know if it's feasible or just way too complicated for me to do.

    2. in the second scenario, I have 2 text fields where the user must enter a value for weight in pounds or kilograms. There is a text box for a value of lbs and a text box for a value in kg. If the user enters a value for books, I'd like to field for kgs be hidden, but still, if they delete this value so that the lbs field becomes empty, I would field for kgs reappear.

    is this feasible or is there another way I might be able to do this?

    For the first, I would not hide the check box for the reason you give. In addition to hide the text field, it must reset it so that any value that the user may have entered is not retained when it is hidden.

    If you really want to show/hide the check box depending on whether there is an entry in the text field, you can use the validation script customized for the text field:

    var f is getField ("unregistered");.

    If (! event.value) {}

    f.Display = display.visible;

    } else {}

    f.Value = "Off";

    f.Display = display.hidden;

    }

    For this script start working, you change the value in the text field.

    For the second problem, what I do, is to have a single text field and two boxes to tick to indicate lbs or kg. If you want to stay with the configuration you have, you can clear the other text field with a custom validation script:

    Script for weight_lbs custom validate field

    If (event.value) getField("weight_kgs").value = "";

    Do the same for the other text field, but change the domain name in the script. This will allow only one field to be filled at the same time and do not bother with the masking.

  • How to enable / disable certain fields based on the value of the checkbox

    This is probably a stupid question, but I was not able to find the trivial solution (I'm fairly new to the user's BlackBerry interface)

    Example scenario:

    Screen of the user interface with two components

    box: "Run daily.

    time field: ' to hh: mm ".

    If the check box is enabled, the hour field must be activated. If the check box is not selected, the time field should be disabled.

    I wasn't able to find a simple solution. The solution is to remove all components and re-create it with different style (Field.NON_FOCUSABLE |) Field.READONLY), but there are significant drawbacks:

    1. It's pretty messy keep the current value (if the user has modified the time field and click twice on the box, I would like to have the same value and the field must be dirty)
    2. She becomes more messy when you have more complicated logic (panels inside panels that should be enabled / disabled based on all parent checkboxes)

    Any ideas?

    Thanks in advance!

    The way I handled it was to the custom methods in areas that allow me to set the disabled and then state substitute TouchEvent, NavigationMovement and NavigationClick methods to search for this variable and simply return true if it is defined. This will take care of the FieldChanged States and targeted to make them unable to be activated.

  • Form of apex - unable to fill in the fields

    Hello

    I use Oracle Apex 4.2 and Oracle 11 G database.

    One of my screens Apex Oracle consists of fields that must be filled from a basetable for some reason any due to the structure of the form and the tables that I can't base my form on this table. If I do this by using the page loading process

    In the Pl/SQL Code, I use multiple selection in the clauses to fill the fields on the Page (form).  However I noticed that the fields are only get filled for the first groups of two radio but which other fields are text fields are not be filled.

    Can someone advise please me if I do something wrong or how to debug and fix this.

    Thank you

    IQ

    HI IQ.

    IQ says:

    I use Oracle Apex 4.2 and Oracle 11 G database.

    One of my screens Apex Oracle consists of fields that must be filled from a basetable for some reason any due to the structure of the form and the tables that I can't base my form on this table. If I do this by using the page loading process

    In the Pl/SQL Code, I use multiple selection in the clauses to fill the fields on the Page (form).  However I noticed that the fields are only get filled for the first groups of two radio but which other fields are text fields are not be filled.

    Can someone advise please me if I do something wrong or how to debug and fix this.

    What are the parameters of the source of the text?

    Are you a person with the form of wizard based?

    Can you reproduce the problem on apex.oracle.com and share the credentials of the workspace?

    Kind regards

    Kiran

  • Reset the Date/time field

    I have a form I created a Date/time field that automatically fills when open.  I also have a reset button so users can reset the form empty.  I'm trying to figure out how to erase all of the data entered on the form and also to reset the date and time.  I could also have the set button to print the form and then erase all data and reset the date/time field?

    Figured it out.  Just need to set the value to the field calculated - read only and execution property: current Date/time

  • Fill in the fields on the customer side dynamically without the reader extensions

    Hello

    Can I make a call to the server of a pdf form using Ajax technology? I want to fill some textfields dynamically on the client side based on a user selection. I have not the license extension drive still make a web service call to the server. Is there another way to achieve the desired requirement?

    Thank you.

    Yes, there is a better way to do it without Reader Extensions.

    AJAX is not an option, because this is not supported by Adobe Reader.

    Here is the solution:

    Write that a REST based web or any Service Server Page that accepts the query string and meets the specified query string.

    Assume that a Page http://myserver.com/EmployeeDetails?EmpId=1234 server returns the details of the employee as comma-separated values.

    This page can be called from PDF using FormCalc

    the syntax is

    ResultField.rawValue = Get ("http://myserver.com/EmployeeDetails?EmpId=1234")

    EmpName.rawValue = ResultField.rawValue.split (",") [1];          Retrieve the name of the emp of result and fill in the field

    Note that if the page or the web service requires authentication, a basic authentication dialog box appears when you call this method.

    In order to better allow anonymous authentication for pages.

    I have implemented this approach in many projects and works very well.

    Hope that helps...

    Nith

  • How to fill in the field on the page with the value of the primary key of the previous page

    I am trying to create a patient monitoring system for a group of doctors. There is a patient form add based on the Patient table (which has Patient_Id as primary key) which branches off toward an preoperative evaluation form. I would like to fill in the field of Patient_Id of pre-surgical assessment with the Patient_Id generated by the page add Patient during treatment, which comes from the Patient_seq sequence. How can I do this? I tried to use a calculation on the pre-operative evaluation form, but no matter what I put, the field remains empty.

    Hello

    If I understand you correctly, once the patient record is created you branching to the next page (preoperative assessment form). First create a static hidden point in the form of patients *: PX_PATIENT_ID_COPY *.

    Create a process on submit after the calculation and validation patient form to get the inserted patient_id of patient table. Here's the code-

    SELECT patient_id into :PX_PATIENT_ID_COPY from patient_table where rownum=1
    
    order by patient_id desc
    

    I would not use the sequence to get the present value, because if the record inserted was removed from your patient table, the current value of the sequence would be invalid to find this record in the patient table.

    Basically when the inserted record, the process of getting the value and put into the hidden element.

    Pass the value of the item hidden on the next page by defining them in the direction of the page. Under the section of the Action in the branch of the page, set this items field type - *: PX_PATIENT_ID * (page the order of the day for patient_id). Type * & PX_PATIENT_ID_COPY.* in the with the field of these values. Make sure that include you the dot (.) after * & PX_PATIENT_ID_COPY *.

    Try it now. Hope that it would help.

    Kind regards

    Djelloul

    Blog: http://aspblog.whitepagesbd.com

    Web: http://tajuddin.whitepagesbd.com

Maybe you are looking for