Something strange ...!!
In the form, we have 2 groups of radio button lists. The values in these lists do not need to be checked unless the individual wants to.
When attempting to submit the email, we receive an error which we seem to trace back to the radio button list values being empty.
Leaving a text field empty and submitting the form does not generate this issue.
I thought about rejigging the form with an example I found below. In this, if a checkbox is checked, you can fill in the phone number value. However, won't this still generate the same "no value provided" as an empty radio button list value (if I change the items in the example below to radio button list select items)??
protected void checkPhoneConfirmation_CheckedChanged(object sender, EventArgs e)
{
if(checkPhoneConfirmation.Checked)
{
textPhoneNumber.Enabled = true;
validatorRequiredPhoneNumber.ValidationGroup = "AllValidators";
validatorRegExPhoneNumber.ValidationGroup = "AllValidators";
}
else
{
textPhoneNumber.Enabled = false;
validatorRequiredPhoneNumber.ValidationGroup = "";
validatorRegExPhoneNumber.ValidationGroup = "";
}
Irregardless, if I leave the values (RBL_CallWhere.SelectedItem.Value and RBL_CallWhen.SelectedItem.Value) in the email body and there is no value... the form bombs on submission.
objMail.Body = "<html><head><title>Feedback Form</title></head><body>"
+ "<p>Name : "
+ txtName.Text + "</p>"
+ "</p>" + "<p>Comments : "
+ txtComments.Text + "</p>"
+ "<p>Email Address : "
+ txtFrom.Text + "</p>"
+ "<p>Account Number : "
+ txtAcct.Text + "</p>"
+ "<p>Phone Number : "
+ txtPhone.Text + "</p>"
+ "<p>Where to Call : "
+ RBL_CallWhere.SelectedItem.Value + "</p>"
+ "<p>When to Call : "
+ RBL_CallWhen.SelectedItem.Value + "</p>"
+ "<p>When to Call - Other Instructions: "
+ txtOther.Text + "</p>"
+ "</body></html>";
Any ideas? Do the radio button values need to be poplulated with something?