Page 1 of 1

[Solved] add css class using jQuery for input type text - problem Formbuilder

Posted: Thu Sep 23, 2010 1:52 pm
by maranc
Hi all, I'm tried add css class for input type=text using jquery.
My code:

{literal}

$(document).ready(function() {  
   $('input[type="text"]').addClass("blablabla");
});

{/literal}


Unfortunelly, I dont know why using this script I can't add any class for input fields in Formbuilder.
This code great works with example FrontEndUser forms? All input[type="text] have added class "blablabla".

Thanks for your help.
Marek A.

PS> This problem is when I load any form in modal window, pop-up window, using some javascript.
If form is in page code my script works fine, sorry that I didn't checked it erlier. But now is problem, how do this in modal window?

Re: add css class using jQuery for input type text - problem Formbuilder

Posted: Fri Sep 24, 2010 1:06 pm
by Peciura
Make sure jQuery library is included on pop-up window. That depends on templates you are using.

Re: add css class using jQuery for input type text - problem Formbuilder

Posted: Fri Sep 24, 2010 1:27 pm
by maranc
I tried add jQuery in form temaple, in hidden div, where is my form - nothing change, I still can't add class trought this fragment of scrip.

Marek A.

Re: add css class using jQuery for input type text - problem Formbuilder

Posted: Sat Sep 25, 2010 8:39 am
by Peciura
This problem is when I load any form in modal window, pop-up window, using some javascript
Have you tried to include jQuery in ?. Do you have a link to your form ?

Re: add css class using jQuery for input type text - problem Formbuilder

Posted: Sat Sep 25, 2010 10:15 pm
by maranc
Yes, I have still call jquery in head section... but I found issue, problem was with gallery module, exactly with lightbox template, witch I use for display images of products. When I changed template for lytebox, slimbox etc. my window modal worked fine. I removed from template [in gallery] call jQuery [there wasn't error call twice, one in head, second in lightbox template]. It's looks like problem with library prototype.js, scriptaculous.js or lightbox.js? I'm not expert in javascript but btw i tested few others java script, example: http://dev.iceburg.net/jquery/jqModal/. This script didn't work on the same page when is called lightbox librarys. I dont know why, but when I removed lightbox this script works fine. I use jQuery 1.4.0 [head section]. On this moment my problem is solved. Yhanks Peciura for your responding and your attention.

Best regards,
Marek A.