TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kumar reddy
NA
11
468
clicking on "sendtestmail" it is not sending
Sep 20 2018 2:19 AM
<div class="form-group">
<label asp-for="SendTestEmailTo" class="col-md-3 control-label"></label>
<div class="col-md-6">
<input type="text" asp-for="SendTestEmailTo" class="form-control" placeholder="Send Test Email To" />
<span id="validation" asp-for="SendTestEmailTo" class="text-danger"></span><br />
<br />
<input name="submit" type="submit" id="sendtestemail" onclick="javascript:SendTestMail();" class="btn btn-inverse" value="submit" />
</div>
</div>
</form>
<script type="text/javascript">
$(document).ready(function SendTestMail () {
$("#sendtestemail").click(function () {
var SendTestMail = $("#SendTestEmailTo").val();
var status = false;
if (SendTestMail == "") {
$("#validation").text("This field cannot be empty.....");
$("#validation").show();
}
else if (SendTestMail != '') {
var regex = /[A-Z0-9._%+-]+@@[A-Z0-9.-]+.[A-Z]{2,4}/igm;
status = regex.test(SendTestMail);
if (!status) {
$("#validation").text("Please enter valid email address");
$("#validation").show();
}
}
if (status) {
$("#validation").hide();
$.ajax({
type: "POST",
url: '/EmailAccount/SendTestEmail',
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
dataType: "json",
});
}
});
});
</script>
Reply
Answers (
1
)
Jquery datepicker value disappear after a submit button post
form validation code will not work