Discussion on:
View:
Show:
In Listing A, where you test for fullname not null and value equal to spaces, should the else cause flag to be set to true rather than false? Same question for contactnumber.
Yes. In addition to these basic syntax errors...
varfullname =
varcontactnumber =
...which should be:
var fullname =
var contactnumber =
varfullname =
varcontactnumber =
...which should be:
var fullname =
var contactnumber =
Thanks for making us aware of the issues with the listings. I contacted the author, and we have updated Listings A and B.
Thanks again,
Mary Weilage
Newsletter Editor
Thanks again,
Mary Weilage
Newsletter Editor
IE is broken in that it allows indices to use parentheses ().
Changing it to brackets lets this work in standard compliant browsers - so change the <nclick event to this -
<nclick="document.getElementsByTagName('p')[0].innerHTML = document.getElementById('fullNameField').value;"
Changing it to brackets lets this work in standard compliant browsers - so change the <nclick event to this -
<nclick="document.getElementsByTagName('p')[0].innerHTML = document.getElementById('fullNameField').value;"
I just changed the line that sets the variable to use brackets. So now you have:
var contactnumber = document.getElementsByName("contactNumber")[0];
Code runs fine in Firefox and IE after that.
var contactnumber = document.getElementsByName("contactNumber")[0];
Code runs fine in Firefox and IE after that.
- Keyboard Shortcuts:
- Prev
- Next
- Toggle









































