window.document.all(???)...........HELP PLease!!! 
Author Message
 window.document.all(???)...........HELP PLease!!!

Folks,
It's my first post here, so please bare with me...

This could be very simple for you all...........
 I'm trying to do this, using
VBScript, I'm trying to hide or display one portion of html document ( DIV
tag).
I found the following way in msdn examples..

***************
window.document.all(strDiv).style.display = strDisplay

<div id="test" style="display: ">

************

**I'm using IE5.5

But when I try to run that, I'm getting scripting error.. Is that the valid
way to access the any elment in html ?? I want to set that "div" element
using VBScript. Can you guys tell me where I might be going wrong??
Is window.document.all(xxx).style.display  a valid way?? If i just give some
numbers intead of xxx it's going without any errors, but the desired result
is not obtained..
i.e window.document.all(0).style.display

CAn you please let me tell me how can I do that for a particular html
element..???

Thanks a lot,
~sri

PS: I found that example I'm referring to at
http://www.*-*-*.com/



Mon, 10 Nov 2003 06:54:08 GMT  
 window.document.all(???)...........HELP PLease!!!
<html>
<head>
<script language="VBscript">
sub toggle_onclick()
  id = "foo"
  sBlock = "block"
  sNone = "none"
  if document.all(id).style.display = sBlock then
    document.all(id).style.display = sNone
  else
    document.all(id).style.display = sBlock
  end if
end sub
</script>
</head>
<body>
<INPUT id="toggle" TYPE="button" value="toggle">
<div id="foo" style="display:block">hello</div>
</body>
</html>

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--

Quote:

> Folks,
> It's my first post here, so please bare with me...

> This could be very simple for you all...........
>  I'm trying to do this, using
> VBScript, I'm trying to hide or display one portion of html document ( DIV
> tag).
> I found the following way in msdn examples..

> ***************
> window.document.all(strDiv).style.display = strDisplay

> <div id="test" style="display: ">

> ************

> **I'm using IE5.5

> But when I try to run that, I'm getting scripting error.. Is that the valid
> way to access the any elment in html ?? I want to set that "div" element
> using VBScript. Can you guys tell me where I might be going wrong??
> Is window.document.all(xxx).style.display  a valid way?? If i just give some
> numbers intead of xxx it's going without any errors, but the desired result
> is not obtained..
> i.e window.document.all(0).style.display

> CAn you please let me tell me how can I do that for a particular html
> element..???

> Thanks a lot,
> ~sri

> PS: I found that example I'm referring to at
> http://msdn.microsoft.com/library/periodic/period99/shaping.htm



Mon, 10 Nov 2003 07:49:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. to print in Pascal

2. Duplicate Error on insert record

3. Formatting Submitted Text HELP PLEASE URGENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

4. window.external.ImportExportFavorites issue...please help

5. LOOKING FOR DELPHI CODER $$$

6. help,help,help,help,help,help,help,help,help,help,help,help,help,

7. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

8. DIRE NEED OF HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

9. MSIE PC and window.newWin.document.write(someFunction()) problems

10. sending windows.document.form.item.value properties into functions

11. Image collision

12. Inserting blobs into Interbase

 

 
Powered by phpBB® Forum Software