function checkName(name) { var ok = true; if (name.length == 0) ok = false; return ok; } function checkFloat(fieldvalue) { var nums = '1234567890.'; if (fieldvalue.length == 0) return true; for (i = 0; i < fieldvalue.length; i++) { if (nums.indexOf(fieldvalue.charAt(i)) == -1) { return false; } } return true; } function checkForm() { ok = true; document.getElementById('amount').setAttribute('class', 'shorttext'); document.getElementById('amount').setAttribute('className', 'shorttext'); if (checkName(document.getElementById('amount').value) == false || checkFloat(document.getElementById('amount').value) == false) { document.getElementById('amount').setAttribute('class', 'shorttext incorrect'); document.getElementById('amount').setAttribute('className', 'shorttext incorrect'); ok = false; } if (ok == false) alert('Please enter correct amount and try again!'); return ok; } document.write("

Shared Contributions

Your name:

Amount (USD):

Most recent donors
Fernando R.$15.00
Total Amount$15.00
Target to reach $250.00
");