0

textareaの「OtherText」値を送信しないことを除いて、すべてが完全に機能しています。

HTML:

<label for="ReasonforRMA">Reason for RMA:</label>
<select name="ReasonforRMA" class="required" id="otherCheck">
<option value="">Choose an option</option> 
<option value="Wrong Item">Wrong Item</option>
<option value="Defective">Defective</option>
<option value="Unit Damaged">Unit Damaged</option>
<option value="Other">Other</option>
</select><br />

<label for="OtherText" id="otherLabel">Other Reason:</label>
<textarea name="OtherText" id="otherText"></textarea><br />

jQuery:

var textarea = $('#otherText');
var textlabel = $('#otherLabel');
textarea.hide();
textlabel.hide();

$('#otherCheck').change(function(){
        var select   = $(this).val();
        if (select == 'Other'){
          textlabel.show();
          textarea.show();
        }
        else {
          textlabel.hide();
          textarea.hide();
        }
});

ASP:

<%
'declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim DealerName
Dim DealerNumber
Dim InvoiceNumber
Dim PONumber
Dim InvoiceDate
Dim ModelNumber
Dim SerialNumber
Dim ReasonforRMA
Dim OtherText
Dim ConditionofUnit

' get posted data into variables
EmailFrom = Trim(Request.Form("EmailFrom")) 
EmailTo = "myemail@email.com"
Subject = "Online RMA Submission"
DealerName = Trim(Request.Form("DealerName")) 
DealerNumber = Trim(Request.Form("DealerNumber")) 
InvoiceNumber = Trim(Request.Form("InvoiceNumber")) 
PONumber = Trim(Request.Form("PONumber")) 
InvoiceDate = Trim(Request.Form("InvoiceDate")) 
ModelNumber = Trim(Request.Form("ModelNumber")) 
SerialNumber = Trim(Request.Form("SerialNumber")) 
ReasonforRMA = Trim(Request.Form("ReasonforRMA")) 
OtherText = Trim(Request.Form("OtherText")) 
ConditionofUnit = Trim(Request.Form("ConditionofUnit"))

' prepare email body text
Dim Body
Body = Body & "Dealer Name: " & DealerName & VbCrLf
Body = Body & "Dealer Number: " & DealerNumber & VbCrLf
Body = Body & "Invoice Number: " & InvoiceNumber & VbCrLf
Body = Body & "PO Number: " & PONumber & VbCrLf
Body = Body & "Invoice Date: " & InvoiceDate & VbCrLf
Body = Body & "Model Number: " & ModelNumber & VbCrLf
Body = Body & "Serial Number: " & SerialNumber & VbCrLf
Body = Body & "Reason for RMA: " & ReasonforRMA & VbCrLf
Body = Body & "Other Text: " & OtherText & VbCrLf
Body = Body & "Condition of Unit: " & ConditionofUnit & VbCrLf

' send email 
Dim mail
Set mail = Server.CreateObject("CDONTS.NewMail") 
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send 

' send confirmation
Dim mailC
Set mailC = Server.CreateObject("CDONTS.NewMail")
mailC.To = EmailFrom
mailC.From = "ouremail@email.com"
mailC.Subject = "Confirmation of your RMA Submission"
mailC.Body = "Test Confirmation"
mailC.Send

' redirect to success page 
Response.Redirect("complete.html")
%>

「OtherText」textarea値以外のすべてを送信しています。タイプミスか何かを推測していますが、何も表示されません。

4

1 に答える 1

2

適切なコーディングの問題として、これらのフォームHTMLフィールドの名前とIDにはまったく同じ文字列を使用する必要があります。潜在的な混乱を回避します。

ASPは、それ自体が理由で、name属性の代わりにID属性を変数名として(誤って)使用している可能性があります。

于 2012-11-13T14:43:19.623 に答える