duplicate form on a web page + focus PROBLEM

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Calimero
Forum Contributor
Posts: 310
Joined: Thu Jan 22, 2004 6:54 pm
Location: Milky Way

duplicate form on a web page + focus PROBLEM

Post by Calimero »

I need to place two forms on the same web page - FORMS ARE THE SAME
like duplicates

I also have JavaScript Focus on field on load

IS THERE A WAY TO MAKE THESE TWO FUNCTION

browser returned error on javascript/ object etc.. problem // pretty sure it is related to this

Any suggestions wellcome

Thanks Ahead !
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post by lostboy »

why would you have duplicates? Give each form a different name and use that in the code
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

~lostboy has a point. I'd just rename one of the forms. They can have the same format and contain the same data, but they can be referenced seperately. However if , for some reason we can't imagine, you need to have the forms named the same, you can refer to them by using document.forms[]. That will allow you to refer to the first form as document.forms[0], and the second as document.forms[1], etc.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply