| re: Updating a texbox with Javascript
Did you try document.getElementById('myText')?
Eliyahu
"Denise" <Denise@discussions.microsoft.com> wrote in message
news:908F31DC-3B89-4ED9-A8D9-B21AAADCE67C@microsoft.com...[color=blue]
> I am working with some pre-written code that dynamically builds a page[/color]
with[color=blue]
> user controls based on data. I need to attach my Javascript to one of the
> controls on the form - I do not have access to the code of the master[/color]
page.[color=blue]
> Because of this my <javascript> ends up inside the <form> tag. I want to
> simply update some textboxes from a grid using Javascript but it does not
> work.
>
> I know that you are not supposed to have the script within the form, but I
> am not at liberty to change the setup - I'm just writing one of the[/color]
controls.[color=blue]
>
> Here is a very simlified view of what I see when I selece View/Source from[/color]
IE:[color=blue]
>
> <HTML>
> <HEAD>
> <title>My Title </title>
> <link href="Includes/styles.css" rel="stylesheet">
> </HEAD>
> <body id="webMainPage">
> <form name="_ctl0" method="post" action="." language="javascript"
> onsubmit="ValidatorOnSubmit();" id="_ctl0">
>
> <script language="javascript">
> function GridRowSelect() {
> document.forms[0].elements['myText'].value = 'Deos not work';
> document._ctl0.myText.value = 'Doesn't work either'; }
> </script>
>
> <TABLE id="Table1">
> <tr><td> .
> </form>
> </body>
> </HTML>
>
> All of the javascript code for the grid control is generated within the
> <form> tags and it seems to work fine. Would SmartNavigation have[/color]
anything[color=blue]
> to do with it? Is there any other way I can get at the field in this
> scenario?
>
> Thanks in advance,
> Denise[/color] |