| You are here: DEVPPL ‹ Forum ‹ Programming ‹ JavaScript Forum |
NOTIFICATIONS
|
|
|||||||||||||||
Login |
Trouble with forms in js file
1 post
• Page 1 of 1
0
Trouble with forms in js file
I would like to make a js file which sets the focus on an element in a form.
But it has to work from different webpages.
So in a webpage it should look something like this:
<script>
set_focus(form1,element1)
</script>
And in the js file it should look something like this:
function set_focus(page_form,page_element)
{
document.page_form.page_element.focus()
}
I know from experience that this doesn't work, but I don't know how to get it right.
Can somebody help me?
But it has to work from different webpages.
So in a webpage it should look something like this:
<script>
set_focus(form1,element1)
</script>
And in the js file it should look something like this:
function set_focus(page_form,page_element)
{
document.page_form.page_element.focus()
}
I know from experience that this doesn't work, but I don't know how to get it right.
Can somebody help me?
- Rune Thandy
- Reputation: 0
- Posts: 1
- Joined: Thu Aug 31, 2006 2:13 pm
- Highscores: 0
- Arcade winning challenges: 0
|
|