JSFiddle - React, Tailwind, and code Playground
by Ninjanoel
HTML
<form method="post" action="#" id="form1">
<div class='row' ID='mainContent_epayLogin_ctl03'>
<label ID='mainContent_epayLogin_ctl04'>Email/Username</label>
<input name="ctl00$mainContent$Login$txtAccount" type="text" id="mainContent_Login_txtAccount" class="lime validate[required]" defaultB="loginForm" />
</div>
<div class="button orange o_lime right Normal">
<a onclick="if (!validateFormmainContent_Login()) return false;"
id="mainContent_Login_ctl09_mainContent_Login_btnSubmit" defaultB="loginForm"
href="javascript:__doPostBack('ctl00$mainContent$Login$ctl09$mainContent_Login_btnSubmit','')">
Submit
</a>
</div>
</form>
CSS
.button
{
margin-left:6px;
margin-right:6px;
background:grey;
width:80px;
}
.button A
{
DISPLAY: block;
FONT-WEIGHT: bold;
FONT-SIZE: 11px;
WIDTH: 101px;
CURSOR: hand;
COLOR: #ffffff;
PADDING-TOP: 5px;
HEIGHT: 20px;
TEXT-ALIGN: center;
TEXT-DECORATION: none;
}
JavaScript
$('input[defaultB]').keypress(function (e) {
if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
alert('enter pressed');
var _el = $('a[defaultB='+ $(e.srcElement).attr('defaultB') + ']');
eval(_el.attr('onclick'));
eval(_el.attr('href'));
return false;
} else {
return true;
}
});
function validateFormmainContent_Login() {
alert('dummy validate method');
return true;
};
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
};
function __doPostBack(eventTarget, eventArgument) {
alert('doing postbacl');
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
alert('about to do submit ' + $('#mainContent_Login_txtAccount').val() ); //noel edit
theForm.submit();
}
};