Information générale
Titre:
Testing for a text box on a page
How can I test if a text box exists on a web page?
I am trying to set focus to a text box when my page loads. The ONLOAD calls this line.
document.MYFORMNAME['txt_part'].focus();
This works great!
However, I build my form on the fly and sometimes my text box is not there. If it is not there, then the above line displays an error message.
Is there a way to test if the text box exists before trying to set focus?
Thanks,
Jerryt
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement