JQTransform - Exclude a styling element?

I use JQTransform to style all form elements. Is it possible to disable styling for a specific element, leaving all the rest in the style of JQTransform?

+6
jquery jqtransform
source share
8 answers

I added if( $input.hasClass('ignore') == true ) { return; } if( $input.hasClass('ignore') == true ) { return; } to line 99 of the plugin to ignore any text fields with class = ignore. Perhaps this will help you.

+9
source share

Use the jqtransformdone class. It is built into the plugin.

+4
source share

I confirm that mattbee's solution worked for me in leiu of the answer from the questioner. As indicated, I inserted the code in line 99 above the following line:

 if($input.hasClass('jqtranformdone') || !$input.is('input')) {return;} 

For those who are not aware of this, insert the code ABOVE line 99, and NOT REPLACE line 99 as follows:

 /*Custom code: Regarding class for elements exceptional to transformation.*/ /*Custom code: http://stackoverflow.com/questions/3727517/jqtransform-exclude-an-element-from-styling*/ if( $input.hasClass('ignore') == true ) { return; } if($input.hasClass('jqtranformdone') || !$input.is('input')) {return;} 

I did not see the opportunity to comment on the mattbee answer, so I presented it in the answer form.

EDIT: The above code will tell jqTransform to skip / exclude / ignore / exclude input elements. In my case, I used it to exclude type = "text" and type = "image". However, applying the .ignore class to a textarea element did eliminate the unwanted conversion, but for some reason further excluded the conversion of my select elements. Note that editing in jquery.jqtransfrom.js for the text area was done in the textarea function, starting at line 201 of the original unedited document, and not in the text field function, starting at line 95 in the above code block.

Here is an example of what I tried (put ABOVE line 207):

 if( $textarea.hasClass('ignore') == true ) { return; } 

I repeat, this worked, but also ruled out the transformation of my blocks of choice, which were not my intentions.

After finding solutions, I came across the following blog post: http://www.deliciouscoding.com/post.cfm?entry=use-jqtransform-and-tinymce-together

Essentially, the table jqTransform creates to replace the textarea elements is replaced with a text field or, more simply, it cancels the conversion:

 <!--Undo textarea transformation.--> <!--Source: http://www.deliciouscoding.com/post.cfm?entry=use-jqtransform-and-tinymce-together.--> <script language="javascript"> jQuery(function(){ jQuery("form.transform table").replaceWith('<textarea></textarea>'); }); </script> 

For those new to jQuery, the above code should be placed at the head of your document (i.e. between <head> and </head> ).

+3
source share

there is a new library that I created - csTransPie - based on jqtransform - jqtransform is a great library, but actually it has a lot of problems, today css3 solves many of these problems, and I like that the controls are normal controls and look like that same thing in every browser

https://github.com/pkoretic/csTransPie

This is work in progress, but even now it is better than jqtransform (more than half of the code has been rewritten, many errors resolved, clear css ...), you have to admit it ...

Just use the .transpie class for the item you want!

+3
source share

Or you can just add the jqtranformdone class to your input :)

+1
source share

Here is my version (Version 1.1 06.08.09) to skip the inputs: edit this in jquery.jqtransform.js on line 497

  $('input:submit:not(.hidden), input:reset:not(.hidden), input[type="button"]:not(.hidden)', this).jqTransInputButton(); $('input:text:not(.hidden), input:password:not(.hidden), input[type="email"]:not(.hidden)', this).jqTransInputText(); $('input:checkbox:not(.hidden)', this).jqTransCheckBox(); $('input:radio:not(.hidden)', this).jqTransRadio(); $('textarea:not(.hidden)', this).jqTransTextarea(); $('select:not(.hidden)', this).jqTransSelect() 
0
source share

You can simply add the "jqtransformdone" class to the element you want to skip the style. Hope this helps someone else.

0
source share

I know this is a very old topic, but I have to say that it is more suitable if you add an extra class to your regular form and it will not be converted. For input texts and textarea, add the jqtranformdone class and it will be returned without conversion. For flags, radio buttons, and selection buttons, the jqTransformHidden class is used.

-one
source share

All Articles