Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Java script in Transformation doesnt work View modes: 
User avatar
Member
Member
dinethnipuna-gmail - 2/12/2014 12:16:55 AM
   
Java script in Transformation doesnt work
Hi All,
I have following class.
<textarea name="p$lt$ctl00$MessageBoard$msgBoard$msgEdit$txtMessage" rows="2" cols="20" id="p_lt_ctl00_MessageBoard_msgBoard_msgEdit_txtMessage" class="TextAreaField">
</textarea><br />

and have following javascript as follows
<script type="text/javascript">
alert("in");
alert($(".TextAreaField").attr("id"));
</script>

I have put this code in a repeater transformation. But once I load the page it show me undefined message.

Help please.

User avatar
Kentico Consulting
Kentico Consulting
Kentico_RichardS - 2/12/2014 2:15:47 AM
   
RE:Java script in Transformation doesnt work
Hi,

Thank you for your message.

Scripts surely work inside transformation. I can see that you are using jQuery selectors. Can you please verify which jQuery are you using? Also if you are using our jQuery you need to use "$j" instead of "$". So it can be like:

alert($j(".TextAreaField").attr("id"));


Let me know how it works.

Kind regards,
Richard Sustek


User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 2/12/2014 6:20:03 AM
   
RE:Java script in Transformation doesnt work
Another option is to use this suggestion.