G
Guest
I am working with some pre-written code that dynamically builds a page with
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 page.
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 controls.
Here is a very simlified view of what I see when I selece View/Source from IE:
<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 anything
to do with it? Is there any other way I can get at the field in this
scenario?
Thanks in advance,
Denise
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 page.
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 controls.
Here is a very simlified view of what I see when I selece View/Source from IE:
<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 anything
to do with it? Is there any other way I can get at the field in this
scenario?
Thanks in advance,
Denise