Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

pdstudio on "Conditional javascript in a post"

$
0
0

Hy,
I have added a shortcode to functions.php for inserting javascript only to logged in users. The shortcode is working, only the javascript fails.
I want to do readonly specific input fields (name=your_name and name=your_email) when a user is logged in.

I have made this:

[member]
<script type="text/javascript">
$('input[name$="your-name"]').attr("readonly", "readonly");
$('input[name$="your-email"]').attr("readonly", "readonly");
</script>
[/member]

But it doesnt works :(.
Where I am wrong? What could be the solution?
Thanks forward for answers!


Viewing all articles
Browse latest Browse all 8245

Trending Articles