Help !! I'm stucked with VBScript .innerText p

Results 1 to 2 of 2

Thread: Help !! I'm stucked with VBScript .innerText p

  1. #1
    Alex Yong Guest

    Default Help !! I'm stucked with VBScript .innerText p

    In my html, I have code like this :<BR>&#060;%<BR> for Cnt = 1 to 3<BR>%&#062;<BR>&#060;font ID="Temp&#060;%=Cnt%&#062;"&#062;Testing&#060;/font&#062;<BR>&#060;%<BR> next<BR>%&#062;<BR><BR>I have a VBScript Sub written below to assign value to the .innerText like below :<BR><BR>Sub Test<BR> <BR>Dim cnt<BR> for cnt = 1 to 3<BR> ("Temp" + cnt).innerText = "New Text"<BR> next<BR>End sub<BR><BR>When I execute the page, errors pop up saying that object required: [string: Temp1]<BR><BR>What should I do????

  2. #2
    Join Date
    Dec 1969

    Default Browers side, not ASP, but....

    &nbsp;<BR>What you have there is not valid VBScript, as it sits.<BR><BR>You can fix it several ways, but best is probably<BR><BR>(document.all("Temp" + cnt)).innerText = "New Text"<BR><BR>or something along those lines. The point is that you must tell the browser that what you want to change is somewhere in the browser window or or or. Your code wasn&#039t doing that.<BR><BR>You *do* know that this won&#039t work in any browsers except newer MSIE browsers, don&#039t you?<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts