javascript - Email not being generated or script not firing? -
this question exact duplicate of:
i have working generate email if "complainttextbox" contains more 30 characters email not generate.??
<script type="text/javascript"> function sendmail(customertextbox, addresstextbox, citytextbox, statedropdown, ziptextbox, modeltextbox, serialtextbox, referencetextbox, complainttextbox, warrentytextbox) { var customertextbox = document.getelementbyid(customertextbox).value; var addresstextbox = document.getelementbyid(addresstextbox).value; var citytextbox = document.getelementbyid(citytextbox).value; var statedropdown = document.getelementbyid(statedropdown).value; var ziptextbox = document.getelementbyid(ziptextbox).value; var modeltextbox = document.getelementbyid(modeltextbox).value; var serialtextbox = document.getelementbyid(serialtextbox).value; var referencetextbox = document.getelementbyid(referencetextbox).value; var complainttextbox = document.getelementbyid(complainttextbox).value; var warrentytextbox = document.getelementbyid(warrentytextbox).value; var body = "please issue rma case." + "\r\n"; body += customertextbox + "\r\n"; body += addresstextbox + "\r\n"; body += citytextbox + "\r\n"; body += statedropdown + "\r\n"; body += ziptextbox + "\r\n"; body += modeltextbox + "\r\n"; body += serialtextbox + "\r\n"; body += referencetextbox + "\r\n"; body += complainttextbox + "\r\n"; body += warrentytextbox + "\r\n";
you should not causing full postback this. trying call javascript function asp.net submit button, changing
<a href="javascript:void(0)" onclick="sendmail('<%=customertextbox.clientid %>')"> <asp:button id="cmdemail1" runat="server" text="generate email rma" width="158px" /> </a>
to this:
<a href="#" onclick="sendmail('<%=customertextbox.clientid %>')"> generate email rma </a>
will start make web development life easier , more scalable.
Comments
Post a Comment