Add class attribute in the input directly

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Add class attribute in the input directly

inigo10rodri
Hello,

I have programmed a function in a external js to validate the fields of the
form. To validate, I consider the name of the control that appears in the
input id within the Liferay proxy-portlet.

The client has asked to create a class from custom css classes of each
control or another way to add a particular class to be able to use it in
more than one field. Therefore, not always take into account the name of the
control, only the class added by us, in this way, we would make the code
more generic.

It is possible to put somewhere the name of the class to the input directly?
Since I have verified that if I add a class in the custom CSS class, it is
added to the whole span instead of the specific input where I want to do the
validation?

Iñigo.

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Add class attribute in the input directly

Alessandro  Vernet
Administrator
Hi Iñigo,

If you specify a class for a control in Form Builder, in the Control
Settings dialog, that class will be present in the generated HTML. In the
case of an input field, it won't be on the input itself, but on a span
around the input. But it is easy enough to target the input inside the span,
whether you want to do it with CSS or JavaScript. You'll let me know if this
works for you.

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Add class attribute in the input directly

inigo10rodri
Thanks for your help, now I can make the validations I want, adding my own
classes in the control configuration with CSS Custom Classes.
 
Iñigo.

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Add class attribute in the input directly

Alessandro  Vernet
Administrator
Excellent Iñigo, and thank you for letting me know.

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet