-1

電子メールを生成するためにこれが機能していますが、「ComplaintTextbox」に30文字以上が含まれていると、電子メールは生成されません.??

<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 a RMA for this 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";
4

1 に答える 1

0

これで完全なポストバックを引き起こすべきではありません。これを変更するだけで、ASP.NET 送信ボタンで JavaScript 関数を呼び出そうとしています。

<a href="javascript:void(0)" onclick="sendMail('<%=CustomerTextbox.ClientID %>')">
            <asp:Button ID="cmdEmail1" runat="server" Text="Generate Email RMA" 
                Width="158px" />
            </a> 

これに:

  <a href="#" onclick="sendMail('<%=CustomerTextbox.ClientID %>')">
            Generate Email RMA
            </a> 

は、Web 開発ライフをより簡単かつスケーラブルなものにし始めます。

于 2013-08-15T17:44:59.797 に答える