You need to sign in to do that
Don't have an account?

Basic JavaScript Help
I have a basic quote app that generates a PDF from Visualforce markup. One of the field in the quote needs to be calculated from data in the quote. I hit a wall with JavaScript. This won’t even write "test":
<script language="text/javascript">
document.write("Test");
</script>
Also I’m not to clear on how to interact with Visualforce variables in JavaScript, do I need to use the brackets and exclamation point? Is what I am trying to do even possible?
Thanks in advanced,
David Orazine
It is possible and I think you just need <script> tags - no language info. For VF variables, you'll need the {!variable} to reference it. For testing, use an alert();
Thank you for your response,
But it still seems to be ignoring my script. Can it be inside the apex:page tag?
Yes, it has to be.
Apparently JS only does not work with rendas equal to PDF :/ Any work around?
javascript does not execute when generating a pdf in visualforce. See the documentation for this and other restrictions.
http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_quick_start_renderas_pdf.htm#kanchor186
You will need to put your logic in an apex controller or extension, or perhaps use a formula field.