troubleshooting Question

object required error when call javascript function

Avatar of apig
apig asked on
JavaScript
3 Comments1 Solution258 ViewsLast Modified:
In my asp page, there are 2 frames, defined like this:

<frameset cols="388*,395" frameborder="NO" border="0" framespacing="0" rows="*">
  <frame name="leftFrm" id="leftFrm" scrolling="NO" noresize src="EditProfile1.asp?merchantid=<%=Request.QueryString("merchantid")%>&fname=<%=Request.QueryString("fname")%>&lname=<%=Request.QueryString("lname")%>">
  <frame name="rightFrm" id="rightFrm" scrolling="NO"  noresize src="editprofile2.asp?<%=Request.QueryString%>">
</frameset>

in EditProfile1.asp (in left frame), there is a javascript function defined like this:

function Movebox(fbox,tbox) {
for(var i=0; i<fbox.options.length; i++) {
if(fbox.options[i].selected && fbox.options[i].value != "") {
tbox.options.length = tbox.options.length + 1;
tbox.options[tbox.options.length-1].text = fbox.options[i].text;
tbox.options[tbox.options.length-1].value = fbox.options[i].value;
   }
}
}

There is button in the left frame:
<input type="button" name="btnAdd" id="btnAdd" onclick="movebox(document.form1.DeptNames,parent.rightFrm.document.form1.Profiles)" value=">">      

document.form1.DeptNames is a listbox in left frame, parent.rightFrm.document.form1.Profiles is another listbox in right frame.

when I click the button and call the movebox javascript function, I always got an "object required" error. This same function used to work fine in my another asp page.

help! Thanks a lot.
ASKER CERTIFIED SOLUTION
CFXPERT

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros