PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

List (2 Columns) [Text, Numeric Value]

  1. Hi,

    I am new to GF...

    I was wondering if there is a way to accept different inputs for List Columns...

    I have a TWO COLUMN LIST for [NAME] and [Share %]

    [NAME] accepts Text Inputs, which works right now
    AND
    [% SHARE] accepts only Numeric Values.

    Is there a way GF can do this?

    Any help is appreciated and thanks in advance :)

    Posted 11 years ago on Thursday August 9, 2012 | Permalink
  2. You can use the gform_column_input filter to specify a different input type for a list field column:
    http://www.gravityhelp.com/documentation/page/Gform_column_input

    However, only text and select are valid options right now. I don't believe there is a way to do this natively. You might be able to skip this filter altogether and add some descriptive text beneath the fields, then perform validation on the client side, with jQuery, or using the gform_validation filter http://www.gravityhelp.com/documentation/page/Gform_validation

    Or, you could use a select box with numeric values to constrain the inputs to numeric only. However, if you can't break it down like 10%, 20%, 30%, etc, you would have to have a select box with 1 to 100%, right?

    Do any of these ideas sound helpful?

    Posted 11 years ago on Thursday August 9, 2012 | Permalink
  3. Hi Chris,

    Many thanks for your reply and assistance..

    I cant use DropDown because the Values are ranging from 0.1 to 100 and on top of that...

    I would need the total of columns to SUM = 100 (100% in human terms)

    An example of 5 rows would be :-
    1) Andrew = 15%
    2) Adrian = 15%
    3) Carol = 30%
    4) Peter = 20%
    5) Alex = 20%
    *** Number of Rows are populated from a value field above the form.. Thanks to GWiz Snippets

    Therefore, I believe performing validation on the client side, with jQuery, or using the gform_validation filter would be the best option...

    Would GF be able to do like the below (with some customization of course)...

    1) Validate Column2 for Numeric Values only
    2) Column 2 must be more than 0.1 and less than 101
    AND
    Total of Column2 must sum up to 100

    Will this be possible and is there any developers in GF that could help me out?

    I am not so great with codes :)

    Thanks in advance!

    Regards...

    Posted 11 years ago on Friday August 10, 2012 | Permalink
  4. Looking into this, there are a lot of variables to consider. Ideally, I think you would prevent the input of incorrect values on the front end, but do some validation on the back end, because you can't rely on client-side JavaScript to ensure the input you receive is valid.

    Ignoring for a moment forcing the input on the client side, you could do some validation on the back end using the gform_validation hook, to force all the inputs to be between 0.1 and 100, and then to total all the values and return an error if they do not add up to 100.

    However, this customization is beyond the support we can provide in the help forums. If you'd like to consider hiring a developer to help you with this, you can find a list of them here, and can post a job on our job board if you like. There are also other resources available if you search for them. Here are just a couple of them with which we are not affiliated with.

    http://jobs.wordpress.net/
    http://wpquestions.com/
    http://jkudish.com/recommendations/

    Posted 11 years ago on Monday August 20, 2012 | Permalink

This topic has been resolved and has been closed to new replies.