You need to sign in to do that
Don't have an account?
Vishal_Thoriya
how to pass an attachment to javascript?
hi all,
i am having an issue with passing the attachment to my javascript
here is my onclick function where i am not getting the value of my attachment
<apex:commandButton onclick="sendMail('{!attachment}');return false;" value="Send" style="margin-left:110px;margin-top:10px;"/>
<apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" style="margin-left:50px;margin-top:50px;">
and the controller side my code is:
public Attachment attachment { get { if(attachment == null) { Attachment attachment = new Attachment(); } return attachment; } set; }
but i am not getting the attachment file ..........
i dont know what is going wrong?
please help me..........
any kind of help will be greatly appriciated........
Hi Vishal,
You have not mentioned in your post :-
Do respond to the above queries for me to find the cause of the issue faced by you.
Why are you trying to pass an attachment to javascript? Why don't you handle everything within the controller?