Hi
We are using the below JavaScript code to postback all rows in a listbox that has been altered using javascript, but it is driving me up the wall as it just errors all the time:
//Javascript post back function
function SaveAddedItems(ctrlSource, ctrlTarget)
{
var Source = eval('document.forms[0].' + ctrlSource);
var Target = eval('document.forms[0].' + ctrlTarget);
for (i = 0; i < Source.options.length; i++)
{
var current = Source.options;
added += ";" + current.value; //ERROR HERE: Microsoft JScript runtime error: Object expected
}
}
Attibute added to VB .NET Page on form load:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cmdStep2.Attributes.Add("onclick", "SaveAddedItems('usrMain__ctl0_chkMetaList', 'usrMain__ctl0_txthiddenControl');")
End Sub
I know this is javascript but I thought this may be a better place to post as it is an ASP .NET workaround.
Any advice would be much appreciated.
Thanks
B
We are using the below JavaScript code to postback all rows in a listbox that has been altered using javascript, but it is driving me up the wall as it just errors all the time:
//Javascript post back function
function SaveAddedItems(ctrlSource, ctrlTarget)
{
var Source = eval('document.forms[0].' + ctrlSource);
var Target = eval('document.forms[0].' + ctrlTarget);
for (i = 0; i < Source.options.length; i++)
{
var current = Source.options;
added += ";" + current.value; //ERROR HERE: Microsoft JScript runtime error: Object expected
}
}
Attibute added to VB .NET Page on form load:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cmdStep2.Attributes.Add("onclick", "SaveAddedItems('usrMain__ctl0_chkMetaList', 'usrMain__ctl0_txthiddenControl');")
End Sub
I know this is javascript but I thought this may be a better place to post as it is an ASP .NET workaround.
Any advice would be much appreciated.
Thanks
B