From: 116 on
I have aparticular form that every time I enter the form name in, that after
closing the page and re-opening it, the name disappears. I even attempted to
enter it directly into the page code. Still it disappears. Any thoughts? I
believe this to be the issue to why I am having trouble running a proven
jscript on this page.

David
From: Jon Spivey on
Without knowing what could be causing this it's usually easier not to name
forms, rather pass the form to your function. Say you have some script that
runs onsubmit

<form onsubmit="return doForm(this);">
type frontpage here <input type="text" name="a" />
<input type="submit" />
</form>

<script type="text/javascript">
function doForm(f){
if(f.a.value!='frontpage'){alert('type frontpage');return false;}
return true;
}
</script>

Apart from removing issues with form names scripts written this way are also
much easier to re-use. Alternative is to reference by index, eg
document.forms[0] <- 1st form on the page
document.forms[1] <- 2nd form on the page
etc

With either of the above approaches the form doesn't need a name atall.

Cheers,
Jon
http://MyMobileDeal.com

"116" <116(a)discussions.microsoft.com> wrote in message
news:CA673338-F86E-4858-B1AA-661CF04AA636(a)microsoft.com...
>I have aparticular form that every time I enter the form name in, that
>after
> closing the page and re-opening it, the name disappears. I even attempted
> to
> enter it directly into the page code. Still it disappears. Any thoughts?
> I
> believe this to be the issue to why I am having trouble running a proven
> jscript on this page.
>
> David


From: 116 on
Thank you. This was the reason for my script not to work. The
document.forms[#].

David

"Jon Spivey" wrote:

> Without knowing what could be causing this it's usually easier not to name
> forms, rather pass the form to your function. Say you have some script that
> runs onsubmit
>
> <form onsubmit="return doForm(this);">
> type frontpage here <input type="text" name="a" />
> <input type="submit" />
> </form>
>
> <script type="text/javascript">
> function doForm(f){
> if(f.a.value!='frontpage'){alert('type frontpage');return false;}
> return true;
> }
> </script>
>
> Apart from removing issues with form names scripts written this way are also
> much easier to re-use. Alternative is to reference by index, eg
> document.forms[0] <- 1st form on the page
> document.forms[1] <- 2nd form on the page
> etc
>
> With either of the above approaches the form doesn't need a name atall.
>
> Cheers,
> Jon
> http://MyMobileDeal.com
>
> "116" <116(a)discussions.microsoft.com> wrote in message
> news:CA673338-F86E-4858-B1AA-661CF04AA636(a)microsoft.com...
> >I have aparticular form that every time I enter the form name in, that
> >after
> > closing the page and re-opening it, the name disappears. I even attempted
> > to
> > enter it directly into the page code. Still it disappears. Any thoughts?
> > I
> > believe this to be the issue to why I am having trouble running a proven
> > jscript on this page.
> >
> > David
>
>
> .
>