Verification of the text field problem and requiring an option in the drop-down field

I have a form with several fields that if the user enters information in one or more of the

fields, I need to check that the drop-down list field is not empty.

I got this to work, but now I find that if the user deletes the text in the text field, the user always receives the error message. Here is the script I use:

If

((form1.page1.ListFilesFolders.rawValue) ! = null & & (form1.page1.windsNtwkAccess.rawValue) == null);

{

xfa.host.setFocus (form1.page1.windsNtwkAccess);

xfa.host.messageBox ("Please make a selection in the field of Windows network."

, 'Need to selection' , 1 , 0);

}

Thank you

MDawn

Makes sense... the field is null when the user deletes the text. You could put a white in these areas as default values and test for this instead of null. Now, when the user empty field, it will be null and will not empty so that the message will not appear.

Make sense?

Paul

Tags: Adobe LiveCycle

Similar Questions

  • Get the value of the drop-down list (selectedIndex) and the text field - does not

    Hi all

    I'm trying to find and change the values selected by the user using a drop-down list and text field. Here's the code.

    ChangeRevDetails();
    function ChangeRevDetails(){
    
    
              var myDialog = app.dialogs.add({name:"Enter copyright information"});
    
    
    //    var monthlist = col1.dropdowns.add('myList', undefined, myList);
    
    
              var col1 = myDialog.dialogColumns.add();
              var col2 = myDialog.dialogColumns.add();
      
        col1.staticTexts.add({staticLabel:"Month:"});
              col1.staticTexts.add({staticLabel:"Year:"});
        col1.staticTexts.add({staticLabel:"Rev. no.:"});
        
        var myList = [ "January", "February",  "March", "April", "March", "April", "May", "June", "July", "August", "Sepetember", "October", "November", "December" ];
    
    
         var myMonth = col2.dropdowns.add({stringList:myList, selectedIndex:0, minWidth:100});//{minWidth:100});
         var myYear = col2.textEditboxes.add({editContents:"2013", minWidth:100});   
         var MyRev = col2.textEditboxes.add({minWidth:100});
    
    
        var RevMonth = (myList [myMonth.selectedIndex]);
        var RevYear = myYear.editContents;
        var RevNumber = MyRev.editContents;
        var RevToReplace1 = RevMonth +", "+ RevYear;
        var RevToReplace2 = RevMonth +", "+ RevYear + " Rev. " + RevNumber;
    
    
        var myResult = myDialog.show();
    
    
            if(myYear.editContents == "") //entry is "" 
            { 
            alert("Please enter some text into the contents field."); 
            ChangeRevDetails(); 
            }
            else if(myResult == true) //user entered datas 
            { 
    
    
                alert (RevMonth);
                alert (RevYear);
                alert (RevNumber);
                alert (RevToReplace1);
                alert (RevToReplace2);
    
    
                app.findGrepPreferences = NothingEnum.nothing;
                app.changeGrepPreferences = NothingEnum.nothing;
    
    
                // grep find/change
                app.findGrepPreferences = app.changeGrepPreferences = null;       
                app.findGrepPreferences.findWhat = "[\\l\\u]+?\\s?\\d{4},?\\s+[\\l\\u]+\\.*\\s+\\d+";
                app.findGrepPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyleGroups.item("Back page"). paragraphStyles.item("Legal_7/9");
                app.changeGrepPreferences.changeTo = RevToReplace1;
                app.changeGrepPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyleGroups.item("Back page"). paragraphStyles.item("Legal_7/9");
                app.activeDocument.changeGrep();
    
    
                app.findGrepPreferences = NothingEnum.nothing;
                app.changeGrepPreferences = NothingEnum.nothing;
      
        } 
        else //implies user clicked cancel 
        { 
        myDialog.destroy(); 
        }
    
    
    }
    
    

    The problem is, it does not take the value that the user selects in the drop-down list and the text field. It takes the default value as "January" and the year is '2013' as these two values are given as selectedIndex:0 and editContents: "2013". I compared the coding with a few other scripts work as well, but it does not work. I added several alert boxes to check the value we get.

    In addition, search for it and change also does not work. Please help me on this. Thank you.

    Kind regards

    Bachi. D

    Change the order of dialogresults:

    ...

    var myYear = col2.textEditboxes.add ({editContents: "2013", minWidth:100});})
    var MyRev = col2.textEditboxes.add({minWidth:100});)
    Ditto var = myDialog.show ();
        If (myYear.editContents == "") //entry is «»
        {
        Alert ("Please enter a text in the content field.");
        ChangeRevDetails();
        }
        else //user entered if(myResult == true) datas
        {
    var RevMonth = (myList [myMonth.selectedIndex]);
    var RevYear = myYear.editContents;
    var RevNumber = MyRev.editContents;
    "var RevToReplace1 = RevMonth + ', '+ RevYear;

    "var RevToReplace2 = RevMonth + ', '+ RevYear + 'Rev' + RevNumber;

    ...

    did not have a look for the problem of change to find

  • Defining form fields such as required based on the entry in the drop-down list

    I'm trying to set the properties of a few form fields as required in the case of a specific value is selected from a drop-down list.

    I entered the code of the tab actions from the drop-down list properties below > mouse down > run a java script. The problem is that it works only if I come out and enter again the drop-down list. "I tried to invoke the code with"Mouse down","Mouse entry", out of the mouse ' none of them worked unless I go out and again the drop-down list.

    Any suggestions?

    Thank you!

    var devused is this.getField ("device");.

    var comptype is this.getField ("Type of complaint");.

    var proname = this.getField ("product name");

    var feels = this.getField ("sent to the sponsor");

    If (comptype.value == 'Associated Product complaint') {}

    devused. Required = true;

    proname. Required = true;

    smells. Required = true;

    }

    else {}

    devused. Required = false;

    proname. Required = false;

    smells. Required = false;

    }

    What you describe is the way documented in what forms Acrobat and Acrobat JS behave by Form Event Processing

    For your described form, we can use a custom format for the field drop-down list script:

    If (event.willCommit! = true & event.changeEx! = "")
    {
    var devused = this.getField ("device");
    var proname = this.getField ("product name");
    Envoy of var = this.getField ("sent to the sponsor");
    Switch (Event.changeEx)
    {
    case "related product": complaint
    devused. Required = true;
    proname. Required = true;
    smells. Required = true;
    break; Go at the end of the switch;
    Repeat fdor each value of the option in the drop-down list.
    by default:
    If no match for the above cases, it is found;
    devused. Required = false;
    proname. Required = false;
    smells. Required = false;
    break;
    } / / end of switch event.changeEx;
    } / / end not true willCommit;

    You must set the ' Commit selected value immediately "and as one moves upwards or downwards the options, the related fields will change and stay together when you exit the field note that the field name is not used in the script because the field is the event object until it leaves the field.

  • I use a 43 in. TV as monitor and have trouble reading the text in the drop-down menu (file, editing, display etc.) boxes. Is it possible to increase the size?

    I downloaded the theme and font size changer, but I cannot increase the size of the text in the drop-down menus. I sit 10 ft away from the TV with a wireless keyboard. Even when I Zoom on the page of the menu drop-down does not increase in size. With the help of a mini Mac OSX 10.3

    I think that the solution is a TV 60 ", but I hope we can find a more affordable solution!

    I think that the menu bar on Mac OS X.

    [Apple] Window helps the Firefox Edit View History bookmarks file tool

    -wouldn't be likely changes via an add-on or a parameter of Firefox.

    However, as a Windows user, I am at a disadvantage by experimenting.

    I've seen a number of discussions on the forums of Apple, without a clear solution:

  • How to make the fields from the drop-down list required to make a selection before you save a PDF file

    I have a PDF form where I entered a JAVA script in some areas by using the option ON BLUR under 'Actions' and it works very well to prevent users to go to another site if they leave the field with the empty JAVA Script in place.

    My question is that I have other form fields that have a drop down menu where they can choose several options. I would also like to make these fields to where they can't move forward on the form unless they choose an option in the list. However, because with the option in the list "choose a ' is a default option entered into the field (field is not empty), script JAVA of BLUR ON option I used in my empty fields does not work to block the user to move beyond the matter without selecting an option. They are able to save the form with all the drop down menus staying to 'pick '.

    I made the field "Required fields" then they are highlighted with the red area around, but is there another tool to force them to choose an option for each in the drop down menus before you save the form, instead of being able to save with leaving the 'choose One' in the field by default?

    The best way to do this without knowing the default value of the field is to compare the value of the field to the default value of the field... You must make sure that your default value is not part of the possible acceptable answer. It works with most of the field types that a user can fill.

    If (event.value! = event.defaultValue) {}

    do something;

    App.Alert ("required field not completed. \nField name: "+ event.target.name, 1, 0);

    }

  • JavaScript to fill the text based on the drop-down list field

    Hello

    I'm trying to write a javascript script to fill a "Textfield" based on what I select in 'Dropdownlist control' this has on a relationship between them. I tried to integrate the script on the category of 'Change' and the script was the following, but it didn't work. I would be grateful if someone can help me with the correct procedure.

    Thank you

    Vijay

    Form1. #subform [0]. DropDownList2 [0]: change - (JavaScript, both)

    function populateDescription() {}

    if (document.subform [0].) {DropDownList2 [0] .value == "BIH")}

    document.subform [0]. TextField83 [0] .value = "Burn in and PBI history."

            }

    }

    I solved this problem by using a script to switch.

    Please see my previous thread in this regard and Paul example will provide you with the right script for a script to switch.

    http://forums.Adobe.com/thread/479021

    script on the drop-down list as follows

    Switch (this.rawValue) {}

    case "dropchoice1".

    FieldName1.RawValue = 'choice of text here ';

    FieldName2. RawValue = "choice of text here ';

    break;

    case "dropchoice2".

    FieldName1.RawValue = 'choice of text here ';

    FieldName2. RawValue = "choice of text here ';

    break;

    }

    Good luck.

  • Text formatting on SegmentedControl and inside the drop-down list

    Hello

    I'm trying to change the color of the text on the buttons of a SegmentedControl and part of a drop-down list.

    I don't want to change the skin, but only the text. With the drop down menu, I managed to change the upper part (just what you see when the drop down menu is closed) using

    myDropDown.button.setTextFormatForState(myUpColor, SkinStates.UP);
    

    etc, but with the elements inside the list and buttons SegmentedControl I can't find a property that lets me set the text format...

    Any ideas?

    It doesn't seem to be an easy way to do.

    The only way would be to extend the SegmentedControl and then override the following method with the following code. It should do the trick. We will work on making that it puts far more easily in the future.

    override protected function onButtonAdded(child : RadioButton) : void
            {
                var dpLength : int = __dataProvider.length;
                child.width = Math.round( width / dpLength );
                // change this to be percentages
                child.groupname = __groupName;
                //Set your formats to whatever you like here.
                            child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_DISABLED ), SkinStates.DISABLED );
                child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_OUT ), SkinStates.UP );
                child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_DOWN ), SkinStates.DOWN );
                child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_SELECTED ), SkinStates.SELECTED );
                child.setTextFormatForState( ThemeGlobals.getTextFormat( ThemeGlobals.SEGMENTED_CONTROL_FORMAT_SELECTED_DISABLED ), SkinStates.DISABLED_SELECTED );
                child.drawNow();
                // set the button text formats here
            }
    
  • How do I automatically populate the text field box based on data generated automatically in the drop-down list?

    I created a drop down list which includes various regions.  When a region is selected it auto-renseigne another drop-down list with places.  I would like to automatically fill a text field with predetermined phone numbers when you have selected a location in the drop-down list of "places".  I want to integrate the phone numbers in the code, since the form will not access a database.  Any help would be greatly appreciated.  Thank you, Ed.

    Hello

    Here is the link to your form. https://Acrobat.com/#d=BaCL7BKKdAcgV3JIk61nZg

    You have the updated field matches in the event changes from the 2nd menu drop-down.

    While referencing you use .page1 while your page is Page1.

    Thank you.

    Sidonie.

  • Drop-down lists of the fill of the text fields on a different page from the drop-down list.

    Hi all

    I have a form with multiple pages. The first page contains a number of drop-down lists. These lists, drop-down list when the option is chosen, must complete a field text on another page. I can get the drop down menu to populate the text field when it is on the same page, but as soon as I move the text field to another page, the script does not work. Can anyone offer a solution? I used javascript on the changes to the scripts.

    Every time reference you the other object... so I guess in the code located on the DDlist.

    Paul

  • Make the field visible if 'Other' selected in the drop-down list

    Is it possible to do a field visible and required if a selection is made in a menu drop-down.

    For example, I have 4 different options in my drop down list, including the 'other' and if other is selected, I want a new text field is visible, so that the user can add more specific information.

    Any help or advice would be appreciated.

    If you use ColdFusion requiredattribute, I don't know how to change this dynamic. But if you do validtion aside client with javascript - or double check it after you submit with ColdFusion, it is easy in principle.

  • Import of text/value in the drop-down menu link tab

    I've done this before and I can't for the life of me remember how I did it. I need to be able to replace the text in the text boxes and the value (as shown below) with the updated text. I don't think I did it by using data binding. Looks like I could use a file .csv or .xml, and copy and paste and I got the result I needed.

    I am sharing the value of several fields. I know that this was not entered manually as there are about 5 000 entries. Any help would be greatly appreciated!

    Thank you, Gary

    10-22-2012 1-06-12 PM.png

    If the clip Panel has copied one column (ex: excel sheet) it copies all lines as values 'Text' from the drop down ONLY.

    If the clip board copied 2 columns column goes into 'Text' and the second column is being 'value '. Default computer will be verified that the item 'specify' values box too.

    All you need here is:

    1. text format and values into 2 separate columns to populate the drop-down list. (can use excel features to generate the worksheet. This step output should be in 2 columns only for text and the values of DD).

    2. place a drop-down list field (no change of properties not required on a TAB(ex: binding))

    3 copy the 2 columns of the spreadsheet and paste it by using the 'paste from the Clipboard' tab 'ground '.

    4. now check the binding tab, must be the values and text for all entries in the worksheet.

    Hope this helps, if I'm wrong if you please ignore it.

  • 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

  • Demanding of the drop-down list in CFMX form fields

    Required form fields in Coldfusion MX 6 help with HTML forms for that I use the following method:

    -a hidden field that has a name attribute composed of the name of the field and the suffix '_required '.

    You can use this technique with CFML and HTML tags form. If the user leaves the FirstName field empty, ColdFusion rejects the submission of form and returns a message informing the user that the field is required. You can customize the contents of this error message.

    For example:
    To require that the user enters a value in the field FirstName for a HTML input tag, I use the following syntax:

    < input type = "Text" name = "FirstName" size = "20" maxlength = "35" >
    < input type = "hidden" name = "FirstName_required".
    value = "You must enter your first name." >

    This is a nice, simple, solution non-javascript. However, it seems to only work for text fields and entered radio, not the drop-down lists. Is there a way to the same demand of the drop-down lists in the form? (I prefer not to have to resort to additional javascript validation)

    I used it with some fields.


    The issue here is that if you have any tag "selected" option
    even an empty option "Select a value" type, this selection has been
    finished and he will not raise a validation error.

  • The drop-down menus, context menus and menu for Auto-filling items are not displayed!

    I FF4 beta, it started from FF4 beta 7. I'm working on Windows 7 ultimate 64-bit.

    The problem is that I can't see drop-down menus unless they have many elements, or context menus (such as highlighting a text then right click on it), auto fill bars no longer view AutoFill info is entered before... the menu itself appears a bit. but it is transparent and I can not display the items, do not know where to click to select the thing I want.

    I don't have this problem before 4.0b7... after I got it, I thought it was one of the plugins, so I disabled them all but still have the problem!

    A picture describing the problem encountered is taken here, now on this page, I've highlighted a text and right click on it: here you can see the menu appears somehow, surrounded by the red border, but I'm not!

    Tools > Options > advanced

    Under navigation try disabling use hardware acceleration when available. It shouldn't affect the context menus like this, but who knows with NVIDIA cards.

  • Police found during the opening of file and not able to solve, but drop-down list fonts?

    Hi, I just downloaded some files from a friend and he sent me a link to download the fonts. I have done so and 98% of the book of fonts, but there are two fonts, with that I fight.

    When I open the file I get the police lack of attention and it asks me to set the fonts. I can't find the police appropriate in the drop-down list if I click "solve" and begin editing the file. Then I met a text which lack of fonts and I'm able to highlight text and change the text for the police appropriate using the text tool and the font you are looking for is in the drop-down list.

    The fonts that are not working are:

    Franchise "BOLD" and BebasNeue

    The problem is there are several separate incidents where occur these fonts, and passing through each change manually would take a lot of time.

    Is there something I can do to fix all at once?


    Thank you

    Harry

    d9c317be81edbaf79cf4e5225a6f2ca8.png83f707320ba36bdec7b840e37c302791.png

    I don't see the two fonts in the list that show you.  I see Bebas Neue xxx but no Bebas Neue without any additional style. Try Bebas Neue Download Bebas Neue police - thousands of fonts for free download

Maybe you are looking for