R
RogerF
Hello I'm trying to refer to a select field in a form, but am having a
problem.
Here is the snipet of code:
...
...
html += '<td class="plaintablerowheader" style="width:40%">'+"Tax
Forms " +'</td>'
html += '<td id=w4list class="plaintablecell">'
html += '<select class="inputbox" name=w4list>'
html += BuildAllW4Select()
html += '</select>'
html += '<a href="" onClick="window.open(\''
html += GetAllW4StForm(this.form)
html += '\')'
html += ';return false;">'
html += '<a href="" onClick="window.open(\''
html += GetAllW4StForm(this.form)
html += '\')'
html += ';return false;">'
Then I have the function defined later on:
function GetAllW4StForm(formobj)
{
var tempurl = ""
var statew4url = ""
var stlinkfound = false
var f = document.getElementById(formobj);
alert(f);
for (var i=0; i<StMarStatusList.length && stlinkfound == false; i++)
{
if (stlinkfound == false && formobj.w4list.selectedIndex == i)
...
...
Well the problem when I run this is it's erroring out on the
formobj.w4list.selectIndex. The javascript message from the browser
reads:
'formobj.w4list.selectedIndex' is null or not an object.
Also the alert(f) returns/displays the value "null".
How do I refer in the function to the w4list select field? I've tried
a coulple of different ways but they also don't work.
Thanks in advance,
Roger
problem.
Here is the snipet of code:
...
...
html += '<td class="plaintablerowheader" style="width:40%">'+"Tax
Forms " +'</td>'
html += '<td id=w4list class="plaintablecell">'
html += '<select class="inputbox" name=w4list>'
html += BuildAllW4Select()
html += '</select>'
html += '<a href="" onClick="window.open(\''
html += GetAllW4StForm(this.form)
html += '\')'
html += ';return false;">'
html += '<a href="" onClick="window.open(\''
html += GetAllW4StForm(this.form)
html += '\')'
html += ';return false;">'
Then I have the function defined later on:
function GetAllW4StForm(formobj)
{
var tempurl = ""
var statew4url = ""
var stlinkfound = false
var f = document.getElementById(formobj);
alert(f);
for (var i=0; i<StMarStatusList.length && stlinkfound == false; i++)
{
if (stlinkfound == false && formobj.w4list.selectedIndex == i)
...
...
Well the problem when I run this is it's erroring out on the
formobj.w4list.selectIndex. The javascript message from the browser
reads:
'formobj.w4list.selectedIndex' is null or not an object.
Also the alert(f) returns/displays the value "null".
How do I refer in the function to the w4list select field? I've tried
a coulple of different ways but they also don't work.
Thanks in advance,
Roger