View Full Version : Resolved String.prototype problem

11-10-2009, 02:11 PM
I am trying to create a custom method for all Strings.

var chkStr = {

isBlank: function() {
if (this.length < 1) return false;
else return true;

String.prototype.isBlank = new chkStr.isBlank;

Later in a function I check the value of a form entry

if (form.formName.field.value.isBlank) {
alert('You left something blank.');

I am getting a myStr.isBlank is not a function error.

11-10-2009, 02:55 PM
Due to a parsing error chkStr.isBlank was not being considered a function.

This was due to something I have not properly identified, but it is definitely not what I thought it was. I am not able to delete this thread and feel like a dunce for negating it so quickly.

Thank you all who go out of their way to help others and took the time to consider helping me.