div.gradFormContain {
display:table;
width:100%;
max-width:1240px;
margin:0 auto;
}
.asTable {
display:table;
width:100%;
}
.asCell {
display:table-cell;
}
.asRow {
display:table-row;
}
p.introP {
font-family:arial,helvetica,sans-serif;
color:#000000;
font-weight:normal;
font-size:34px;
line-height:44px;
}
form.gradCardForm {
width:100%;
max-width:1240px;
margin:20px auto;
font-family:arial,helvetica,sans-serif;
color:#000000;
padding-top:0;
padding-bottom:20px;
padding-left:0;
padding-right:0;
}
form.gradCardForm table {
width:90%;
max-width:675px;
margin-top:20px;
margin-bottom:0;
margin-left:auto;
margin-right:auto;
font-family:arial,helvetica,sans-serif;
color:#000000;
}
form.gradCardForm td.left {
width:25%;
min-width:170px;
padding-bottom:40px;
}
form.gradCardForm td.right {
width:75%;
padding-bottom:40px;
}
form.gradCardForm tbody {
border:0;
}
form.gradCardForm h2 {
display:block;
margin:5% auto;
width:90%;
padding:0;
text-align:left;
font-size:36px;
line-height:36px;
font-weight:bold;
margin-top:0;
color:#000000;
}
form.gradCardForm textarea {
display:block;
width:90%;
min-height:185px;
padding:3%;
border:1px solid #61625d;
margin:0 auto;
font-size:22px;
line-height:33px;
font-weight:normal;
margin-bottom:40px;
}
form.gradCardForm label {
font-size:28px;
line-height:28px;
}
form.gradCardForm input[type='text'] {
width:90%;
display:block;
border:1px solid #61625d;
height:30px;
padding-left:5%;
padding-right:5%;
padding-top:10px;
padding-bottom:10px;
font-size:25px;
line-height:25px;
}
form.gradCardForm input[type='submit'] {
display:block;
width:90%;
max-width:400px;
height:80px;
background-color:#d46012;
border:0;
color:#FFFFFF;
font-weight:bold;
font-size:38px;
cursor:pointer;
margin:20px auto;
padding:0;
text-align:center;
}
div.asCell.cardImage {
width:40%;
background-image:url("https://www.womenforwomen.org/sites/default/files/WFW_GraduationCultivation_LP_book.png");
background-repeat:no-repeat;
background-size:contain;
}
div.asCell.innerForm {
width:60%;
}
#content.column {
background-image: url("http://www.qa.womenforwomen.org/sites/all/themes/wfwi/images/header-bg-wide.jpg?1446484747");
background-repeat: repeat;
}
#content-header {
background-color: #d46012;
background-image: none;
text-align: center;
height:auto;
}
#content-header h1 {
display: table-cell;
vertical-align: middle;
margin-top: inherit;
letter-spacing: 3px;
line-height: 1em;
text-transform: none;
font-size: 2.8em;
}
.breadcrumb ol {
display: none;
}
p.errMsg {
display:none;
font-family:arial,helvetica,sans-serif;
color:red;
font-size:18px;
line-height:18px;
}
#textarea_feedback {
margin: 0 auto;
padding: 0;
width: 90%;
text-align: right;
}
div.asCell.innerForm .main p {
margin:0;
padding:0;
}
@media (max-width:640px) {
div.asCell.cardImage {
display:none;
}
p.introP {
padding-bottom:0;
margin-bottom:0;
}
form.gradCardForm input[type='submit'] {
font-size:28px;
}
form.gradCardForm h2 {
font-size:30px;
}
form.gradCardForm label {
font-size: 18px;
line-height: 18px;
}
form.gradCardForm td.left {
padding-bottom: 0;
min-width:108px;
}
form.gradCardForm td.right {
padding-bottom: 0;
}
}
$(document).ready(function() {
var data = $("form").serialize();
$.ajax({
url: "run.do",
type: "POST",
data: data,
success: function(tableData){
alert(tableData);
}
});
var text_max = 250;
var text_length = $("#crdMsgField").val().length;
var text_remaining = text_max - text_length;
$("#textarea_feedback").html(text_remaining + " characters remaining");
$("#crdMsgField").keyup(function() {
var text_length = $("#crdMsgField").val().length;
var text_remaining = text_max - text_length;
$("#textarea_feedback").html(text_remaining + " characters remaining");
});
});
// isEmail (STRING s [, BOOLEAN emptyOK])
// whitespace characters
var whitespace = " \t\n\r";
//
// Email address must be of form
[email protected] ... in other words:
// * there must be at least one character before the @
// * there must be at least one character before and after the .
// * the characters @ and . are both required
function isValidEmail(s)
{
if (isEmpty(s)) return false;
// is s whitespace?
if (isWhitespace(s)) return false;
// there must be >= 1 character before @, so we
// start looking at character position 1
// (i.e. second character)
var i = 1;
var sLength = s.length;
// look for @
while ((i < sLength) && (s.charAt(i) != "@"))
{ i++
}
if ((i >= sLength) || (s.charAt(i) != "@")) return false;
else i += 2;
// look for .
while ((i < sLength) && (s.charAt(i) != "."))
{ i++
}
// there must be at least one character after the .
if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
else return true;
}
// Check whether string s is empty.
function isEmpty(s)
{
return ((s == null) || (s.length == 0))
}
// check length of textarea
function isTooLong(s)
{
return (s.length > 250)
}
// Returns true if string s is empty or
// whitespace characters only.
function isWhitespace(s)
{
var i;
// Is s empty?
if (isEmpty(s)) return true;
// Search through string's characters one by one
// until we find a non-whitespace character.
// When we do, return false; if we don't, return true.
for (i = 0; i < s.length; i++)
{
// Check that current character isn't whitespace.
var c = s.charAt(i);
if (whitespace.indexOf(c) == -1) return false;
}
// All characters are whitespace.
return true;
}
function checkForm() {
if (isEmpty(document.subscribeForm.elements['Card Message'].value)) {
document.subscribeForm.elements['Card Message'].style.backgroundColor='yellow';
// alert("Please enter a Card Message.");
document.getElementById('genErr').style.display = "block";
document.getElementById('cmErr').style.display = "block";
document.subscribeForm.elements['Card Message'].focus();
return false;
}
else if (isTooLong(document.subscribeForm.elements['Card Message'].value)) {
document.getElementById('genErr').style.display = "block";
document.getElementById('cmErrLength').style.display = "block";
document.subscribeForm.elements['Card Message'].focus();
return false;
}
if (isEmpty(document.subscribeForm.elements['First Name'].value)) {
document.subscribeForm.elements['First Name'].style.backgroundColor='yellow';
// alert("Please enter a First Name.");
document.getElementById('genErr').style.display = "block";
document.getElementById('fnErr').style.display = "block";
document.subscribeForm.elements['First Name'].focus();
return false;
}
if (isEmpty(document.subscribeForm.elements['Last Name'].value)) {
document.subscribeForm.elements['Last Name'].style.backgroundColor='yellow';
// alert("Please enter a Last Name.");
document.getElementById('genErr').style.display = "block";
document.getElementById('lnErr').style.display = "block";
document.subscribeForm.elements['Last Name'].focus();
return false;
}
if (!isValidEmail(document.subscribeForm.elements['Email Address'].value)) {
document.subscribeForm.elements['Email Address'].style.backgroundColor='yellow';
// alert("Please enter a valid Email Address. (
[email protected])");
document.getElementById('genErr').style.display = "block";
document.getElementById('emErr').style.display = "block";
document.subscribeForm.elements['Email Address'].focus();
return false;
}
}