0
 '<field name="id_'.$filter_record['id'].'_hourfrom" type="integer"
                        label="from" description="Delivery Hour Range"
                         size="'.$filter_record['holdout'].'"
                        maxlength="20"
                        required="true"
                        class = "hourfrom"
                        first = "1"
                        last = "'.$filter_record['list_limit'].'"
                        step = "1"
                        filter="user_utc" />

I have this code above which dynamically generates input fields in the view using XML. The problem is that I want to add a custom attribute so I can use it in javascript processing.

for example: value_type = "single"

When I try to add this in the code above, in the processed page, it is not displayed, and I cannot also get the attribute.

Is there a proper way to do this?

1 Answer 1

1

Joomla does not renders all the attributes which you mention in the xml.

There are limited set of attributes which are made visible or their relevant action is added in the field html.

So i would suggest you to add your custom parameter in the class attribute so that it will be visible and you can perform your javascript processing by fetching the class on that element.

2
  • you mean like this? class = "hourfrom holdout-7" Commented Mar 11, 2015 at 7:28
  • yes, class="hourfrom attribute_name-value" for better clarity
    – Nick
    Commented Mar 11, 2015 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.