JRS: In article <nI******************************@comcast.com>, dated
Wed, 30 Aug 2006 21:49:31 remote, seen in news:comp.lang.javascript,
McKirahan <Ne**@McKirahan.composted :
><PR********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googleg roups.com...
>I have a form that appears several times on a page, and would rather
not assign IDs.
Is there a way to have my validation function focus() a text input
without IDs?
Use something like onClick="Try(this.form)"
with
function Try(F) { with (F) {
... } }
// or with F. before the names of the controls rather than using with.
OTOH, if the appearing forms are the same, why?
AND, code to be executed should not be repeated in the source; you can
write your form with a javascript function (and then it's easy to give
each one a sequenced or other ID).
return false;
} else {
return true;
}
There's no need to put an else after a return.
OP : read the newsgroup FAQ.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.