Script needed for radio button/date field

Hello

I am currently using Adobe Lifecycle Designer ES.  I have a form that contains two radio buttons (each dependant on the other).  One of the option buttons, if it is enabled, has a date field that I have needed to fill if this option button is selected.  I suppose that this could be done with an "if" statement, but I'm not very good at the code and I was wondering if anyone can help?  Thank you.

Hello

I have an example here: http://assure.ly/hxHupW.

You can change the required property using script.

To make a field required, you set the property to "error". Considering that, to make an optional field, you set the property to "disabled".

If one considers that the value of the radiobutton that you want to use to define the mandatory datefield is '1', then the code following JavaScript in the click event of the radiobutton exclusion group:

if (this.rawValue == 1)
{
     datefield.mandatory = "error";
}
else

{
     datefield.mandatory = "disabled";
}

Hope that helps,

Niall

Tags: Adobe LiveCycle

Similar Questions

  • Insert Radio button data

    I'm not able to get < cfinsert > work into a remote DB2 database.  I could get cfquery INSERT is to be inserted in the DB2 database.  I was not able to get radio button data into this database.

    That's what I tried:

    ___________________________________________________
    surveyForm.cfm:
    < html >
    < head >
    < title > < /title > survey form
    < / head >
    < body >
    < h2 > Enter a survey form < / h2 >

    < action = "surveyAction.cfm cfform" method = "post" > "

    Branch:
    < cfinput type = "text" name = "BRANCH" size = "4" maxlength = "4" > < br > < br >

    Contact name:
    < cfinput type = "text" name = "CONTACT_NAME" size = "40" maxlength = "40" > < br > < br >

    Do you have what it takes today? & nbsp
    < cfinput type = "radio" name = "NEED_FLAG" id = "radio" value = "O" > Yes
    < cfinput type = "radio" name = "NEED_FLAG" id = "radio" value = "N" > No.
    < cfinput type = "radio" name = "NEED_FLAG" id = "radio" value = "X" > has no response < br > < br >

    < br > < br >
    < input type = "Submit" value = "Submit" > < input type = "Reset".
    value = 'Clear Form' > < table >

    < / cfform >
    < / body >
    < / html >
    ___________________________________________________
    surveyAction.cfm:
    < html >
    < head > < title > survey form insert < / title > < / head >
    < body >

    <!-it works until I have add the radio for the insert button->
    <! - insert the new record - >

    < cfquery datasource = "AXMISC_SURVEY" >
    INSERT INTO THE INVESTIGATION. CAF_SURVEY
    (BRANCH, CONTACT_NAME, NEED_FLAG)
    VALUES
    (< cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form.) "BRANCH # ' >.
    < cfqueryparam cfsqltype = "cf_sql_char" value = "#form. CONTACT_NAME #">"
    < cfqueryparam cfsqltype = "cf_sql_char" value = "#form. NEED_FLAG #">"
    )
    < / cfquery >

    < / body >
    < / html >
    ___________________________________________________

    Thank you
    Jeanne

    zer0Weaver wrote:



    INSERT INTO THE INVESTIGATION. CAF_SURVEY
    (BRANCH, CONTACT_NAME, NEED_FLAG)
    VALUES
    ( ,
     
        
    )

    Hi Jeanne,

    Thank you to post relevant information, but you forgot to mention what _is_ now ;-)  An error occurs, and if so what is the error message, etc... ? But I think would be that you are missing a comma in the VALUES clause (...):

    VALUES
    (
    ,
    ,

    )

  • Affect of Session Variables for radio buttons

    Sorry if this may have been partly answered in another post, but I can't seem to find the answer.

    I have a form with radio buttons, as well as other fields of the form. If the user presses the button submit, it takes them to a processing page that has a lot of validation controls, spits out an error message to the user and displays a 'back' button to return to the previous page for corrections.

    All my text entry boxes are assigned for the field 'value' and they all have the excellent work of session variables. After the user presses the back button go, data is re-settled back in the fields. However, I can't understand how to assign a session variable to my radio buttons. Here is my code:

    < cfinput required = "Yes" message = "you must enter Y or N for calendar - work during the audit C" type = "radio" value = "YES" name = "check" > YES
    < cfinput required = "Yes" message = "you must enter Y or N for calendar - work during the C check" don't type = "radio" value = "" name = "check" > No.

    You can see that unlike the text boxes, the value field is already filled, so I'm confused as to where to add the session variable. Here's what looks like my text entry field:

    < cfinput type = "text" name = "ccheck_total" size = "8" validate = "integer" message = "The Aircraft Total field may contain the numbers." value = "#session.ccheck_total #" >

    I'm pretty sure that I will need a statement < cfif > on my processing page, but am confused how to code. Please help.

    In HTML you add just CHECKED at theline. I think the cfinput hand is similar. You could then cfif VERIFIED according to session value (YES or NO)

    for example.checked...

    EDIT: UH what he says. :)

  • Script to fill in the date field and disable the form

    Hi all

    With little experience of Adobe I was tasked to create a set of PDF forms to use in my company. I drew using Pro forms, but I need a digital signature field that will fill a separate date field at the signing and also disable some of the fields in the form. For the moment I can get it to do one or the other, but I can't do both.

    Is there a script that I can use for these functions?

    Thank you

    KC

    As you have probably seen, there is an option on the signing tab to run a script when a digital signature is applied.

    Do what you have described what follows can be used (of course, you have to adapt the name of the field):

    this.getField("SignatureTime").value = util.printd ("mm/dd/yyyy", new Date()); Enter the date with the current date

    this.getField("Text1").readonly = true; The value of some fields read-only

    this.getField("Text2").readonly = true;

    this.getField("Text3").readonly = true;

    this.getField("Text4").readonly = true;

    etc.

  • Update for a null date field

    Hello world

    I have a web page called quality which has several records on it with several people connected to it at the same time, update. I'm trying to update a date field and it works, but then if I try to erase it and update, it is not update it a Null value. When I put in the code to try to update as a null in the update request, he puts a date of 01/01/00 in the field for some reason any and also updates the other fields empty to this day. I have something to explain the drop Downs nulls in my other fields. The code I used for those who was like that in the update query:

    Set Approval_Initials = < cfqueryparam cfsqltype = "CF_SQL_VARCHAR" value = "#Evaluate('form.) (PDF_Creation_Doc_Control_Approval_Initials #id #') # ' null = "len (trim (Evaluate('form.) #NOT". ' (PDF_Creation_Doc_Control_Approval_Initials #id #'))) # "/ >

    I need to use something like this again for the field Date, except with the tag CF_SQL_DATE? Here's what I have for the field Date right now:

    < Cfif DisplayQualityDate.recordcount >

    < cfif isDefined "(form. ("Quality_Date #id # ') and evaluate"(form. ("Quality_Date #id # ') NEQ" ">" ".

    < cfquery Datasource = '#application. DataSource #">"

    Approval of the update

    Set Approval_Date = ' #Evaluate ("form. (Quality_Date #id #») #

    WHERE APV_ItemID = #id # AND Document_Type = 'quality '.

    < / cfquery >

    < / cfif >

    < / cfif >

    Is this enough information? What does the CF_SQL_DATE do exactly? Any help would be greatly appreciated.


    Andy

    Andy,

    A couple of things to think about:

    1. Are the date columns in your database that is configured to accept null values?
    2. The database recognizes dates into the format that your users do not penetrate into the (i.e.: "d/m/yy")?

    You should be able to use similar logic to null cfqueryparam = on your form field data.  CF_SQL_DATE will tell your database the value passed is a date, and not another type of data.

    -Carl V.

  • Images for Radio buttons

    In my form, I have three radio buttons:
    Priority < br >
    < cfinput type = "radio" name = "priority" value = "1" > 1
    < br >
    < cfinput type = "radio" name = "priority" value = "2" > 2
    < br >
    < cfinput type = "radio" name = "priority" value = "3" > 3
    < br >

    My action page takes the value of the priority and then did a little cfsets, calculations, etc., then inserts into a table. So far so good.

    Now I get a requirement to replace the three boxes with three colorful pictures (to make them stand out on the screen).
    So if I click on the first image that represents the priority 1, then I need to capture this value and send it to my page of action for treatment. If I click on image 2, then send the value 2, etc. It should work exactly as option buttons, so that only one value is selected and sent. Given that the images will replace the buttons and text (1, 2, 3), I have to somehow indicate and/or display picture that has been selected.

    Is it possible to do? If so, can someone please show me how do?

    Thank you

    Ah I see what you're trying to do. Try this:

  • Create the form in word with checkboxes, radio buttons, comment fields and signatures

    A couple of years, I have created a form that has been filled with some radio buttons and checkboxes, then sent for signatures. Example below:

    Project owner : {{                   $ReqName}}

    {{I0}} {{K0}}

    Udio has

    Project Manager:

    {{$K1}}

    {{$K2}}

    {{$K3}}

    APPROVED

    REVISE and resubmit

    DENIED

    {{SBlk1_es_:signatureblock: signer1}}

    {{#ReqName = * RequiredName_es_:sender}}}}

    Is it still possible to use, or should I drag-and - drop all the buttons?

    Hi sarahm62404467,

    Yes, you can do it with services eSign, but central form is abandoned.

    Kind regards
    Nicos

  • Add 180 days for a new date field

    I have a form where we want users to enter/select a date into a date/time field and have another date automatically calculate the entries of 180 days after the date - end date.  I'm new to FormCalc and I was wondering if anyone had a simple code to solve this problem?

    The output of the field event date, you can do this:

    var beginDate = Date2Num($,"YYYY-MM-DD")

    endDateField = Num2Date (beginDate + 180, "YYYY-MM-DD")

    Make the endDateField a text field, not a date field - you specify the date format in the Num2Date() code (I like 'YYYY-MM-DD', but you can make different variants).

    You'll want to implement models of display, editing and Validation on the date field so that you get a suitable date. The view model is the appearance of the date on the screen, the editing model for how people can enter the data (you can have more than on Edit pattern to allow some flexibility) and the date must pass the Validation model to be valid. It's a good idea to specify the date format in the caption for field and a ToolTip for form fill know how enter the date properly if they do not use the popup calendar.

  • Values for radio button is not selected.

    Hi all

    I have two regions and the two regions has radio buttons in that. First, I select the option buttons in the first region and then I select the option buttons in the second region at this point in time, the values in the option boxes first region remains not chosen secomd region values remain selected! Why is this behavior?

    Thank you

    Hello

    Check the 16855 application in your workspace. It may be useful

    Sunil Bhatia

  • created by the script of a radio button. Need help on the Cancel button.

    Hello

    After you run this script, when I choose German, french or button of Italy and clicked on Cancel button, then window should be closed but it shows for example to alert respective 'German clicked u. "

    Thank you

    Marie rosine

    var win = new window ('dialog');

    win.alignChildren = 'left ';

    victory. German = win.add ('radiobutton', defined, 'German');

    victory. French = win.add ('radiobutton', defined, 'French');

    victory. Italy = win.add ('radiobutton', undefined, 'Italy');

    win.cancelBtn = win.add ("button", undefined, "Cancel");

    win.quitBtn = win.add ("button", undefined, "Ok");

    win.defaultElement = win.quitBtn;

    win.cancelElement = win.cancelBtn;

    victory. German.Value = true;

    win.quitBtn.onClick = function() {}

    end = 1;

    Win.Close ();

    }

    win.cancelBtn.onClick = function() {}

    end = 1;

    Win.Close ();

    }

    Win.Show ();

    If (win. German.Value is true)

    {

    Alert ('German clicked u')

    };

    If (win. French.Value is true)

    {

    Alert ('clicked u French')

    };

    If (win. Italy.Value is true)

    {

    Alert ('clicked u Italy')

    };

    var win = new Window ("dialog");
    win.alignChildren = "left";
    win.German = win.add ("radiobutton", undefined, "German");
    win.French = win.add ("radiobutton", undefined, "French");
    win.Italy = win.add ("radiobutton", undefined, "Italy");
    win.cancelBtn = win.add("button", undefined, "Cancel");
    win.quitBtn = win.add("button", undefined, "OK");
    win.defaultElement = win.quitBtn;
    win.cancelElement = win.cancelBtn;
    if (win.show() == 1){
     if (win.German.value == true)
     {
      alert ("u clicked German")
     };
     if (win.French.value == true)
     {
      alert ("u clicked French")
     };
     if (win.Italy.value == true)
     {
      alert ("u clicked Italy")
     };
    }
    
  • Equium U400 - what drivers I need for the buttons of enlightenment?

    LED button!

    Help! I traded a new hard driver and I reinstalled the operating system with another disk of vista, because I don't have a disk backup image. I installed all the drivers driver toshiba Center. Then, after My LED button on the front not working anymore.

    Furthermore, what is the correct order for installing these drivers. Are there instructions? I wonder if the LED buttons problem was caused by the installation of an incorrect order.

    06/03/08 acoustic silencer
    Toshiba Windows Vista 32 Bit 2.02.00 World Wide
    06/03/08 Assist
    Toshiba Windows Vista 32bits 2.01.04 World Wide
    Update the BIOS from 30/04/09
    Toshiba OS independent 4, 00-WIN32 World Wide
    06/03/08 Bluetooth monitor
    Toshiba Windows Vista 32bits 4.01 World Wide
    25/08/09 Bluetooth Stack
    Toshiba OS independent NA World Wide
    06/03/08 Chip Set Utility
    Intel Windows 32-bit Vista 8.3.0.1014 World Wide
    06/03/08 Config Free
    Toshiba Windows Vista 32bits 7.1.26 World Wide
    06/03/08 DVD Player
    Toshiba Windows Vista 32bits 1.20.10 World Wide
    06/03/08 display driver
    Intel Windows 32-bit Vista 15.6.1.1329 World Wide
    30/06/09 face recognition
    Toshiba Windows Vista 32 bit 2.0.17.32 World Wide
    06/02/09 Fingerprint Software
    AuthenTec Windows Vista 32 bit 2.5.29.0 World Wide
    06/03/08 flash Media Driver
    O2Micro Windows Vista 32 Bit 3.19.1 World Wide
    06/03/08 HDD Protection Utility
    Toshiba Windows Vista 32bits 2.0.2.3 World Wide
    06/03/08 the HDMI Control Manager
    Toshiba Windows Vista 32bits 1.6.0.4 World Wide
    06/03/08 hardware Setup
    Toshiba Windows Vista 32bits 3.0.1.0 World Wide
    06/03/08 LAN Driver
    Marvell Windows Vista 32 bit 10.51.4.3 World Wide
    06/03/08 driver Modem
    Conexant Windows Vista 32 bit 7.70.00.00 World Wide
    06/03/08 region Select utility Modem
    Toshiba Windows Vista 32bits 2.2.3.2 World Wide
    06/03/08 modem on Hold utility
    Toshiba Windows Vista 32 bit 2.5.52 World Wide
    25/05/09 online product information
    Toshiba Windows Vista 32 bit 2.06.0000 World Wide
    06/03/08 pro network connection software
    Intel Windows 32-bit Vista 11.5.0.0.3 World Wide
    06/03/08 Robson package
    Intel Windows 32-bit Vista 1.5.0.1013 World Wide
    06/03/08 SD utilities
    Toshiba Windows Vista 32bits 1.8.1.1 World Wide
    25/05/09 driver Sound
    Conexant Windows Vista 32 bit 4.36.10.0 World Wide
    06/03/08 supervisor password utility
    Toshiba Windows Vista 32bits 3.0.1.0 World Wide
    31/08/09 TEMPRO
    Toshiba Windows Vista 32bits 2.0.6 World Wide
    06/03/08 driver TRS
    Toshiba Windows Vista 32 Bit s/o world wide
    06/03/08 tiles for Mobility Center
    Toshiba Windows Vista 32bits 1.01 World Wide
    06/03/08 Touch Pad Driver
    Synaptics Windows Vista 32 bit 10.1.7.0 World Wide
    06/03/08 Touch Pad Driver
    Alps Electric Windows Vista 32 bit 7.0.302.8.1 World Wide
    06/03/08 added value package
    Toshiba Windows Vista 32bits 1.1.14 World Wide
    06/03/08 WPS library
    Toshiba Windows Vista 32bits 1.003 World Wide
    06/03/08 driver Webcam
    Chicony Windows Vista 32 bit 6.2.208.1217 World Wide
    09/03/09 Wireless Lan Driver
    Realtek Semiconductor Corporation Windows Vista 32 bit 6.1158.0113.2009 World Wide
    09/03/09 Wireless Lan Driver
    Intel Windows 32-bit Vista 12.2.0.11.3 World Wide
    09/03/09 Wireless Lan Driver
    Atheros Windows Vista 32 bit 7.7.0.288.0 World Wide

    Hello

    Normally for buttons of enlightenment, you must install the Toshiba Value added Package, but you have already installed.
    I'm not sure, but what you reinstall it already?

    But what you hear with light buttons are no longer works?
    Is the lighting on or off? You get an error message?

    The lights can also be enabled or disabled in the BIOS.
    Check this box!

    Welcome them

  • ??? Simple Script needed for Illustrator?

    Greetings.

    I was wondering if anyone knew a well-known script there that for Illustrator that could automate this process (see attachment).

    Much appreciated!

    Screen Shot 2016-02-02 at 10.42.46 AM.png

    as long as all boxes are aligned, then this should do the trick.

    // number Items
    var doc = app.activeDocument;
    var items = doc.pathItems;
    var loc = [];
    for(var i = 0; i < items.length; i++){
        var item = items[i];
        loc.push([item.position[0], item.position[1], item]);
    }
    
    loc.sort(function (a, b) {
        if (a[1] > b[1]){
            return -1;
        }else if (a[1] < b[1]){
            return 1;
        }else{
            if (a[0] < b[0]){
                return -1;
            }else if (a[0] > b[0]){
                return 1;
            }
            return 0;
        }
    });
    
    for(i = 0; i < loc.length; i++){
        var txt = doc.textFrames.add();
        txt.contents = i+1;
        //alert(loc[1][2].left);
        txt.position = [loc[i][2].left+10,loc[i][2].top - 10];
    }
    
  • Support for the creation of multiple automatic date fields fill

    I have created a form that contains 31 date from 01/02/12 sea areas.  I try to get the auto form fill the other 30 boxes as 02/02/12 game and so on until the end of the month or in this case continue until March 2.

    If you name your fields of text something like "date1", "date2",..., "date31", the following could serve as the validation script customized for the first date field (date1):

    // Custom Validate script
    (function () {
    
        var sDate;
    
        // Convert entered value (string) to a date and get its value in milliseconds
        var d1 = util.scand("mm/dd/yyyy", event.value).getTime();
    
        // Populate the other date fields by incrementing this date
        for (var i = 2; i < 32; i += 1) {
    
            // Determine the new date string
            sDate = util.printd("mm/dd/yyyy", new Date(d1 + (i - 1) * 864e5));
    
            // Set/Clear the current field
            getField("date" + i).value = event.value ? sDate : "";
    
        }
    
    })();
    

    If the first field is disabled, it erases the other date fields as well.

  • What to put in the xsd schema for the form of the ADF radio buttons?

    Hello, we create a form generated from the data of a HT ADF auto which is a type defined in a schema .xsd. Which schema component Let's in the .xsd schema correspond to buttons option in the form of the ADF? For example, in our .xsd we just

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < xsd: Schema container = ' http://www.w3.org/2001/XMLSchema "xmlns:wf =" " http://www.example.org "

    " targetNamespace = ' http://www.example.org "elementFormDefault ="qualified"> "

    < xsd: complexType name = "FormDataType" >

    < xsd: SEQUENCE >

    < xsd: element name = "FirstName" type = "xsd: String" / >

    < xsd: element name = "Name" type = "xsd: String" / >

    < xsd: element name = "Department" type = "xsd: String" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: Schema >

    What would be the element / type etc be for radio buttons?

    Hi Tali,

    It depends on what you want to do with radio buttons, but it would be better to be a part of string in most cases.

    This could be better handled on the ADF OTN forum, but I'll take a shot at it.  If you have many items to choose from, you can use the string "Department", you already have in your XSD.  When displayed on the form, include various departments with radio buttons next to each other (for example,"manufacturing", "Marketing", "Sales").

    Because this is the BPM forum, I guess your XSD is used as data for a human task which in turn used to create a form of the ADF.  If this is the case, you can use your "Department" in your XSD string element that has already been placed on your form as a text input field.  The reason is the link that you need to update the element of the human task service is automatically created in this way.  Select this field to text, and then in the properties panel, copy the text that is in the 'value' of the field (you stick it in the Value property of the Radio group you will add in the next step).

    There are two ways to get the radio buttons on the form.  You might drag the "Radio group" widget on the form-> click on radio to 'Create a list (select an item)' button-> click the Add icon to add the choices you want to appear on the form (for example,' manufacturing ', 'Marketing', 'Sale').   Once this was added, paste property value text you copied in the previous step into the field of "Value" property of the new Radio group.

    If you select the radio button of the new group source, it should look like this if you wanted two choices for your radio buttons:

    After this has been added, delete the existing text entry field that was created when the form was generated automatically from the human task.

    Hope this helps,

    Dan

  • FormCalc or Javascript for the radio buttons?

    I need to write a script that uses radio buttons.

    If a radiobutton is selected (my radiobuttion is called rbJanuary) then textbox1 = textbox2.

    How I write this and it's in FormCalc or Javascript? Thank you!

    Hello

    It doesn't matter what language you use for your request, it will work in both while FormCalc has a thinner syntax.

    FormCalc:

    if ($ eq 1) then
              Textfield1 = Textfield2
    else
              Textfield1 = ""
    endif
    

    JavaScript:

    if (this.rawValue === "1") {
              Textfield1.rawValue = Textfield2.rawValue;
    } else {
              Textfield1.rawValue = "";
    }
    

Maybe you are looking for

  • Satellite L750: can't play Battlefield 3 due to the graphics card driver

    Hey guys and girls, I just bought a new satellite L750 and I want to play battlefield 3 on it... but when I start to play the game, the game tell me to update the drivers above 288,7, but when I look at this site there is to refresh 266,8...One would

  • How can I get rid of the Flash Drive password?

    I recently bought a 16 GB USB key. When I plugged it in (Win 7 Ultimate) it came as improved storage and I created passwords.Now I can't use it on Vista and Xp computers. On vista I right click and select unlock, but nothing happens. On XP it appears

  • iBook Wi - Fi to the new airport?

    I have an iBook clamshell beautiful (Graphite) with /Airport. wireless card I have a new Airport Base Station Extreme Home (2015) and of course I can't access to iBook using WPA2Personal. I wonder if I can connect an old spaceship Airport to the curr

  • Error biohd 1 and 2.

    Error biohd1 and 2. Everything was fine before, until I have shut down for the night. It keeps asking for a restart and select a proper boot device or insert boot media and press a key. I have a p6360a

  • When trying to send an email to my printer, I have always 'System error' ndo no impression.

    When trying to send an email to my printer, I have always 'System error' ndo no impression.  How can I know what could be the problem.