add properties to a form

I need to add properties to my form to work with a jquery libraries

<?php
echo $this->tag->form(array("spm_contacto/create",
                                                    "autocomplete" => "off",
                                                    "class" => "form-horizontal", 
                                                    "data-abide" => "",
                                                    "novalidate" => ""));
?>

But when you add does not save, while

<?php
echo $this->tag->form(array("spm_contacto/create",
                                                    "autocomplete" => "off",
                                                    "class" => "form-horizontal",));
?>

if it works, if you save

edited May '16

you can use jquery append() (at end) or prepend() (at top) to add properties( .attr( ) ) or select options to your element in your document.ready()..



36.3k
edited May '16

just like that

<script>
    $(function () {
        $('#formulario').attr('data-abide', '').attr('novalidate', '');
    });
</script>

dont work

<script> $(document).ready(function () { $('#formulario').attr('data-abide', 'myValue')... }); </script>