public static String getJsObjectForFieldsValue(final Set<Object> inputIds,
            final Set<Object> checkboxIds, final String alternativeFunction) {

        if (StringUtil.isBlank(alternativeFunction)) {
            throw new InvalidValueException(
                    "alternativeFunction cannot be blank");
        }

        final StringBuilder builder = new StringBuilder(75);

        builder.append('{');

        for (final Object id : inputIds) {

            builder.append(id.toString()).append(':')
                    .append(alternativeFunction).append("('")
                    .append(id.toString()).append("').value,");

        }

        for (final Object id : checkboxIds) {

            builder.append(id.toString()).append(':')
                    .append(alternativeFunction).append("('")
                    .append(id.toString()).append("').checked,");

        }

        builder.replace(builder.length() - 1, builder.length(), "}");

        return builder.toString();
    }
public static String getJsObjectForFieldsValue ( final Set < Object > inputIds , final Set < Object > checkboxIds , final String alternativeFunction ) { if ( StringUtil . isBlank ( alternativeFunction ) ) { throw new InvalidValueException ( "alternativeFunction cannot be blank" ) ; } final StringBuilder builder = new StringBuilder ( 75 ) ; builder . append ( '{' ) ; for ( final Object id : inputIds ) { builder . append ( id . toString ( ) ) . append ( ':' ) . append ( alternativeFunction ) . append ( "('" ) . append ( id . toString ( ) ) . append ( "').value," ) ; } for ( final Object id : checkboxIds ) { builder . append ( id . toString ( ) ) . append ( ':' ) . append ( alternativeFunction ) . append ( "('" ) . append ( id . toString ( ) ) . append ( "').checked," ) ; } builder . replace ( builder . length ( ) - 1 , builder . length ( ) , "}" ) ; return builder . toString ( ) ; }
@param inputIds
input field ids such as input type text
etc..
@param checkboxIds
checkbox field ids such as input type
checkbox
@param alternativeFunction
alternative function name for
document.getElementById
@return the JavaScript object for the fields value. Sample :
<code>{usernameInputId:document.getElementById('usernameInputId').value,dateExpiredCheckboxId:document.getElementById('dateExpiredCheckboxId').checked}</code>
@since 3.0.1