Validation Issue

Validation Issue

I'm trying to validate a form using jQuery and for some reason even when a value is selected it is still coming up as empty. Can someone tell me what is wrong?

   
  1. function ValidateItem(item, useValLength, message, scrollTo, focus) {
  2.     var aReturn;
  3.     if (useValLength) { aReturn = $('#' + item).val().length > 0; }
  4.     else aReturn = $('#' + item).length > 0;
  5.     if (message && !aReturn) alert(message);
  6.     if (scrollTo && !aReturn) ScrollToPosition(0, scrollTo);
  7.     if (focus && !aReturn) { $('#' + item).focus(); ScrollToElement(item); }
  8.     return aReturn;
  9. }
  10. function ScrollToElement(item) {
  11.     var el = $.browser.opera ? $("html") : $("html, body");
  12.     var aTop;
  13.     if ($('#' + item).offset())
  14.         aTop = $('#' + item).offset().top;
  15.     else
  16.         aTop = document.getElementById(item).offsetParent.offsetTop;
  17.     alert(aTop);
  18.     el.animate({ scrollTop: aTop }, 'slow');
  19. }
  20. function ScrollToPosition(x, y) {
  21.     var el = $.browser.opera ? $("html") : $("html, body");
  22.     el.animate({ scrollTop: y }, 'slow');
  23. }
  24. function validation() {
  25.     var aReturn;
  26.     aReturn = ValidateItem("input[type='radio'][name='RentalPropertyType']:checked"false"Please select a type of property.", 510, null);
  27.     if (!aReturn) return aReturn;
  28.     aReturn = ValidateItem("RentalPropertyAddress"true"Please enter the property's address."nulltrue);
  29. }