Make the obligatory comment fields

Hey BC community.

Any of you have a client to request that the comment fields be mandatory? I know that they are subject to the approval of the content, but he asked.

Any help would be appreciated,


See you soon,.

Pat

Hello Pat,.

The feedback form using the validation as well as any other form. You just need to add the if statement for the correct field, you want to be required.

So for the full name text entry field, you have to add this:

  • If (theForm.fullname) why += isEmpty (theForm.fullname.value, "Full name");

Then for the email address:

  • If (theForm.EmailAddress) why += checkEmail (theForm.EmailAddress.value);

Add them on top of the captcha validation and keep it just like any other form. You can clean the code of validation with http://jsbeautifier.org/

Here is an example:

http://BCG-sandbox.hotpressplatform.com/_blog/blog/post/nope_this_one_is/

Hope this helps,

Chad Smith | http://bcgurus.com/Business-Catalyst-Templates for only $7

Tags: Business Catalyst

Similar Questions

  • Selection of the language makes the required password field

    Hello

    I use jDeveloper 12.1.2

    I have a login page with name, password selection and the language of the user (component SelectOneChoice - soc1). I have a value change listener in the field of languages selectonechoice which will set the locale to the newly selected language. I put partial triggers on the name field and the password of the user for soc1. It comes to make the labels the user name and password appear in the selected language. This makes the password field if necessary even if there is value in the field. I also noticed that this occurs only when the language is other than English.

    My lines jsff for the user name, password, and language are-

    "< af:inputText label =" #{loginBean.usernameLabel} "id ="it1"value =" #{loginBean.username} "required ="true ".

    showRequired = "true" autoComplete = "off" partialTriggers = "soc1.

    / >

    "< af:inputText label =" #{loginBean.passwordLabel} "id ="it2"value =" #{loginBean.password} "required ="true ".

    secret = "true" showRequired = "true" autoComplete = "off" partialTriggers = "soc1.

    / >

    < af:selectOneChoice label = 'language '.

    "value =" #{loginBean.Language} "id ="soc1"binding =" #{loginBean.soc1} "autoSubmit = 'true '.

    valueChangeListener = "#{loginBean.localeChangeListener} '"

    >

    < af:selectItem label = 'English' value = "" id = "si1" binding = "#{loginBean.si1}" / >

    < af:selectItem label = 'French' value = 'fr' id = "si2" binding = "#{loginBean.si2}" / >

    < / af:selectOneChoice >

    The value change listener code is-

    Private Sub changeLocale (language: String) {}

    This.setLanguage (Language);

    Locale newLocale = new local (language);

    FacesContext context = FacesContext.getCurrentInstance ();

    context.getViewRoot () .setLocale (newLocale);

    }

    {} public void localeChangeListener (ValueChangeEvent vce)

    changeLocale (vce.getNewValue m:System.NET.SocketAddress.ToString (()))

    }

    I have the tag f: view with the locale defined as local = "#{loginBean.locale}". "

    Whenever I change the language other than English, the password field is back with the error required, even if there is value in the field. He can't if I choose the language than English. can anyone shed light on what I'm doing wrong here.

    Thank you

    UMA

    Hello

    I think you are missing immediate = "true" in the selectOneChoice.

    If this does not work, check this post; ADF and JHeadstart: skip validation on selectOneChoice selection

    Kind regards

    Ruben.

  • How to make the PDF text field to be strikes do not copy/paste from previous text fields?

    Dear friends

    Helps to solve a problem related to the fields of PDF text, please

    Is there a way to make a PDF of the respondent, which ends of fields text to type own text not copy/paste of the previous text fields?

    Thank you very much!

    Copy the following code, used as key event custom field of your field, will prevent to enter more than one character at a time, which means that copy it text from an external source is not possible:

    if (event.change.length>1) event.rc=false;
    

    However, you can inform your users of this restriction, or they think that something is wrong with the file.

  • How to make the code comments?

    I don't know how make code comments, but I never really learned conventions for her. When should you comment on something? What is the standard allows you to comment on a field? A method?
    Ask him because this trig Solver in that I was average in the quarter got so much hand I'm lost in my own code and had to stop.

    As you can see no human being could possibly do anthing out of this without comment, that I was coding it I was fine. But when I woke up the next morning and has started again, I was lost.
    package trianglesolver;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.GroupLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    
    public class Main {
    
        static boolean alreadyPressed = false;
    
        public static void main(String[] args) {
            JFrame mainFrame = new JFrame();
            mainFrame.setLocation(100, 100);
            mainFrame.setSize(480, 140);
            mainFrame.setTitle("Triangle Solver");
            mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            mainFrame.setResizable(false);
            JPanel mainPanel = new JPanel();
            mainFrame.add(mainPanel);
            GroupLayout grouplayout = new GroupLayout(mainPanel);
            grouplayout.setAutoCreateGaps(true);
            grouplayout.setAutoCreateContainerGaps(true);
            JMenuBar menuBar = new JMenuBar();
            JMenu file = new JMenu("File");
            menuBar.add(file);
            mainFrame.setJMenuBar(menuBar);
            JMenuItem exit = new JMenuItem("Exit");
            file.add(exit);
            mainFrame.setVisible(true);
            exit.addActionListener(new ActionListener() {
    
                public void actionPerformed(ActionEvent e) {
                    System.exit(0);
                }
            });
            JLabel angleA_Label = new JLabel("Angle A");
            final JTextField angleA = new JTextField("0", 8);
            JLabel angleB_Label = new JLabel("Angle B");
            final JTextField angleB = new JTextField("0", 8);
            JLabel angleC_Label = new JLabel("Angle C");
            final JTextField angleC = new JTextField("0", 8);
            JLabel sideA_Label = new JLabel("Side A");
            final JTextField sideA = new JTextField("0", 8);
            JLabel sideB_Label = new JLabel("Side B");
            final JTextField sideB = new JTextField("0", 8);
            JLabel sideC_Label = new JLabel("Side C");
            final JTextField sideC = new JTextField("0", 8);
            JButton solve = new JButton("Solve");
            solve.addActionListener(new ActionListener() {
    
                public void actionPerformed(ActionEvent e) throws NumberFormatException {
                    if (alreadyPressed == false) {
                        double A = Double.parseDouble(angleA.getText());
                        double B = Double.parseDouble(angleB.getText());
                        double C = Double.parseDouble(angleC.getText());
                        double a = Double.parseDouble(sideA.getText());
                        double b = Double.parseDouble(sideB.getText());
                        double c = Double.parseDouble(sideC.getText());
                        if (a != 0 & b != 0 & c != 0) {
                            A = Math.acos((Math.pow(a, 2) - Math.pow(b, 2) - Math.pow(c, 2)) / (-2 * b * c));
                            B = Math.asin((b * Math.sin(A)) / a);
                            angleA.setText(String.valueOf(Math.toDegrees(A)));
                            angleB.setText(String.valueOf(Math.toDegrees(B)));
                            angleC.setText(String.valueOf(180 - Math.toDegrees(A) - Math.toDegrees(B)));
                            angleA.setCaretPosition(0);
                            angleB.setCaretPosition(0);
                            angleC.setCaretPosition(0);
                        } else if (a != 0 & b != 0 & C != 0) {
                            c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2) - 2 * a * b * Math.cos(Math.toRadians(C)));
                            B = Math.asin((b * Math.sin(Math.toRadians(C))) / c);
                            sideC.setText(String.valueOf(c));
                            angleB.setText(String.valueOf(String.valueOf(Math.toDegrees(B))));
                            angleA.setText(String.valueOf(180 - Double.valueOf(angleB.getText()) - Double.valueOf(angleC.getText())));
                            sideC.setCaretPosition(0);
                            angleB.setCaretPosition(0);
                            angleA.setCaretPosition(0);
                        } else if (b != 0 & c != 0 & A != 0) {
                            a = Math.sqrt(Math.pow(b, 2) + Math.pow(c, 2) - 2 * b * c * Math.cos(Math.toRadians(A)));
                            B = Math.asin((a * Math.sin(Math.toRadians(A))) / a);
                            sideA.setText(String.valueOf(a));
                            angleB.setText(String.valueOf(String.valueOf(Math.toDegrees(B))));
                            angleC.setText(String.valueOf(180 - Math.toDegrees(B) - Double.valueOf(angleA.getText())));
                            sideA.setCaretPosition(0);
                            angleB.setCaretPosition(0);
                            angleC.setCaretPosition(0);
                        } else if (a != 0 & c != 0 & B != 0) {
                            b = Math.sqrt(Math.pow(a, 2) + Math.pow(c, 2) - 2 * a * c * Math.cos(Math.toRadians(B)));
                            C = Math.asin((c * Math.sin(Math.toRadians(B))) / b);
                            sideB.setText(String.valueOf(b));
                            angleC.setText(String.valueOf(String.valueOf(Math.toDegrees(C))));
                            angleA.setText(String.valueOf(180 - Double.valueOf(angleB.getText()) - Math.toDegrees(C)));
                            sideB.setCaretPosition(0);
                            angleC.setCaretPosition(0);
                            angleA.setCaretPosition(0);
                        }
                        alreadyPressed = true;
                    }
                }
            });
            grouplayout.setHorizontalGroup(
                    grouplayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(angleA_Label).addComponent(angleA).addComponent(angleB_Label).addComponent(angleB).addComponent(angleC_Label).addComponent(angleC).addComponent(sideA_Label).addComponent(sideA).addComponent(sideB_Label).addComponent(sideB).addComponent(sideC_Label).addComponent(sideC).addComponent(solve));
        }
    }

    Comments won't save sloppy code. Don't throw all your code in a method.

  • How to make the optional password field to create the user form?

    Hello

    IM generate a random password when I create a new user on OIM.

    The only problem is that I do not know how to do the fields:
    -Password
    -Confirm password

    ... be optional.

    Since they are mandatory, the user must enter a password, even if it will not be used, because I generate a random password and overwrite.

    I already looked in the FormMetaData.xml in the section

    < name of the form '3' = >

    ... but the fields, I would like to make optional are not included.

    Any help is appreciated.
    Adriano.

    Certainly, you need to change tjspGenerateCreateUserForm.jsp

    Example:



    value = "abcd1234" Refresh = "true" readonly = "true" styleClass = "Fields" tabindex = "1" / >



    value = "abcd1234" Refresh = "true" readonly = "true" styleClass = "Fields" tabindex = "2" / >

    See metalink Note 468779.1

  • makes the other required fields

    If I select a checkbox, I want to do a drop down field required.

    Use this code as the mouse script to the top of the box (adjust the name of the field in the code to match real field name in your file):

    this.getField("Dropdown1").required = (event.target.value!="Off");
    
  • Search in the comment field in iTunes no longer works

    I use the latest version of iTunes. For each song, I wrote different types of information in the comment field. Suddenly the search function does not include the comment field more. It's very frustrating. I searched this forum and searched through Google. Unfortunately, without success, none of the tips that I found can solve the problem. Hoping to find some help here.

    The deposited comment is actually displayed in the playlist when you're looking? Some fields do not appear in a search if they are not displayed.

  • What is the easiest way to add the "comment field" of each step of a sequence, in the test html report file?

    I use Teststand 3.0, and I would like to have the comment field of each step of my movie file teststand appearing in my html report file.

    I guess I'll have to change the model of teststand ReportGen_html, but I would like to have your opinion to do so in the most simple...

    I have already changed it the SequencialModel for other purposes, but the ReportGen_html seems to be much more complicated to change...

    Thanks in advance for your help (and sorry for the bad English)!

    I converted the wire quotes as an example to 3.0.

    The approach is quite similar to my suggestion with a difference: instead of using custom step types, the example uses substitutions of callback to copy the string.

    Norbert

  • Buttons on the right side of my window a 'comment' field and 'fill and sign' open whenever I open a document. In order to read the text, I need to minimize this field. As I open many documents every day I change the settings so

    Buttons on the right side of my window a 'comment' field and 'fill and sign' open whenever I open a document. In order to read the text, I need to minimize this field. As I open many documents every day, I would like to change the settings so that this field is reduced by default. Is this possible?

    Hi joelh68258411,

    The issue was already fixed in the update, please refer to this note of release hide the tools Panel in Acrobat and Acrobat Reader DC at all times.

    Kind regards

    Nicos

  • Can I make the fields that I created in Acrobat Pro MS justified downtown?

    Hi everyone it should be so simple but really hitting my head. I try to get the fields that I created in Acrobat Pro ms to center then justify text when user types it is the Center not on the left side. I can set the size of text and other but cannot find how to make the above... Thank you

    Yes, it can be done. Go to the properties of the field and under the Options box tick the box 'Allow Rich Text Formatting'.

    Leave the form editing mode, click the field and press Ctrl + E. This will open the properties bar where you can set several formatting options for text, including to set it as "align justified."

  • I want to extract information from the same input field in multipal PDFs (created using document pro) and export them to an excel file. Is this possible? If this isn't the case, Adobe seeks to make this project a reality.

    I want to extract information from the same input field in multipal PDFs (created using document pro) and export them to an excel file. Is this possible? If this isn't the case, Adobe seeks to make this project a reality.

    -Extract all data from a single file can be done via the tools - forms - more form Options - export data...

    -Extract some data from a single file will require a script to measure.

    -Extract all the data from multiple fields in a single file can be done via the tools - forms - more form Options - merge data files into spreadsheet...

    -Extraction of data from several files will require a script Custom Action, as I've written before.

  • How to increase the length of line comment fields

    Hello

    as requested by a customer, we need to know if it is possible to increase the length of line comment fields.

    In fact, the size is:

    for allergens/intolerances/additives comment field-> DB limit = 256 characters; Web = 125 character limit

    for field nutrient comment-> to the defined benefit limit = 512 characters; Web = 250 characters limit

    We need to increase both limits up to 1000 characters.

    I hope my question is clear.

    Thank you and best regards.

    Michele

    Hi Michele,

    You can increase the size of the field or the size of the text for the field of comment allergens/intolerances/additives by following steps:

    1, go to \Web\gsm\BaseForms\UserControls\ctlComplianceContainedGrid.ascx, open the file

    2, go to line 102:

    3, edit theCellRepresentation.getTextareaCellEditor or the width of the field, save the file, refresh your page open or create a new page, then this field will change to the newly configured size

    Notes: the maxinum supported text is 4000 characters

    Unfortunately, the comment nutrient field do not support 256 characters. I suggest that submit you an improvement if it necessary business.

    I hope this helps.

    Thank you

    Jessie

  • How can I make a button to be interactive so when its checked or clicked, the next tab fields become required field?

    I'm trying to create a form that contains a button to select a credit card or check.  When someone chooses the credit card, I need to become a required credit card information fields.  In the contrary case, it they select check, all the fields of credit card (number, exp. date, security code...) to be non-mandatory field.

    Why use a button. If you have a checkbox or a radio button, you can use the available actions for one of these fields to adjust the properties of the fields depending on what widget in the Group has been selected that can be to make the required, visible and required fields and then reset/clear the other group of fields, do so in read-only and disabled the requirement.

  • How to make the field as a table display only?

    A form on a table, I can do the display as field: "view only".

    In a tabular presentation, it doesn't seem to be the option "View only" view. In tabular form attributes, I set a default value, and I have no users to edit this field. So, how can we make the field only do "display"?

    V4.1

    You can change the definition of the column and change the Display as in "Display text (saved state)" attribute whose value will be the column will be saved with the other columns and the default way.

    Thank you
    -Jorge

  • How to make the selection of the field to calculate the properties of the tab active

    I try to make a purchase order that will calculate the values of fields, but I can only select all form fields or not.  I got the trial AcrobatPro and it worked fine, but now I bought it, it does not work for me.

    Can someone please.

    Capture.JPG

    Some people feel that for some reason any. You can try to use the SPACEBAR to toggle the checkbox and the tab key to move. You can apparently also use the mouse, but you will need to click anywhere near the border in checkboxes, so try to experiment a bit.

Maybe you are looking for

  • fe Xoom to 4.0 update

    What kind of progress, if any did you in this upgrade. I relize you don't actually have the Board upgrade of the FE to 4.0 just is it posible to techanically. I'm starting to believe that the full upgrade was just a ploy of marketying not you hgave y

  • Screen resolution problem. Cannot set above 680 x 480.

    Screen resolution problem I have a dell latitude d630 2.5 GHz computer laptop under XP Professional 64-bit operating system.  The screen resolution will not be set above 680 x 480, and when I try to increase the computer stops with a black screen mes

  • location of the key product?

    so I just bought a laptop and when I use a word, that it says I have to enter the product key, I tried to read the help section, but I have no idea what I'm doing, does anyone know where I can find the product key? It's windows vista by the way, than

  • WRT1900AC VPN...

    I see options passthtough VPN is this router, but no provision for VPN from the internet.  Has it been to see it in the near future (without having to go to third party firmware)? Other routers in this class have supported VPN, but done wrong.  I bou

  • Vista - unable to manage another user account

    I am connected to a user has administrator rights account. I select- Control Panel > user accounts > manage another account > 'screen' - permission to continue > continue > "choose the account you want to change." = No user accounts to select from.Du