In a standard web page, you would do something like
1<input id='username' .../>
.
This cannot be dropped into a portal because when the portal aggregates the page you may end up w/ multiple input fields all sharing the 'username' id.
Instead you must namespace all ids so that they are unique on the portal page.
Depending upon the framework you're using, there are different ways to ensure the ids for the portlet are unique.
If your javascript is looking for generic ids, such as 'username', it must be aware that the actual ID rendered on the page may be namespaced. So your 'username' guy, when namespaced, would be something like 'my-portlet-war:blah:username' (depending upon the framework you're using), and your javascript must know how to find the properly namespaced id rather than just 'username'.
Please sign in to flag this as inappropriate.