![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | How to change img scr in vbscript Hi I am trying to change the img scr in code by using the if document, ('Test').scr="vqsol_small.gif" then document("Test").scr="Newimg.gif" <DIV STYLE="Position : Absolute ;Left: 320px; Top : 01px; Width : 400px"> <img NAME="Test" src="VQSol_Small.gif" width="80" height="50"> </DIV> this wont work can someone tell me if this can be done in vbscript? if so can someone help me please. Regards |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How to change img scr in vbscript Hi, try changing NAME="Test" with ID="Test", then use: If Test.scr="vqsol_small.gif" Then Test.scr="Newimg.gif" Massimo. "vqthomf" <vqthomf@xxxxxx> ha scritto nel messaggio news:68898DC2-5956-499A-877A-AF604349EC69@xxxxxx Quote: > Hi I am trying to change the img scr in code by using the if document, > ('Test').scr="vqsol_small.gif" then document("Test").scr="Newimg.gif" > > <DIV STYLE="Position : Absolute ;Left: 320px; Top : 01px; Width : 400px"> > <img NAME="Test" src="VQSol_Small.gif" width="80" height="50"> > </DIV> > > this wont work can someone tell me if this can be done in vbscript? if so > can someone help me please. > Regards |
My System Specs![]() |
| | #3 (permalink) |
| | Re: How to change img scr in vbscript the error I get is object doen't support this property or method: 'Test.scr' Thanks for your help "M Piceni" wrote: Quote: > Hi, > > try changing NAME="Test" with ID="Test", then use: > If Test.scr="vqsol_small.gif" Then Test.scr="Newimg.gif" > > Massimo. > > "vqthomf" <vqthomf@xxxxxx> ha scritto nel messaggio > news:68898DC2-5956-499A-877A-AF604349EC69@xxxxxx Quote: > > Hi I am trying to change the img scr in code by using the if document, > > ('Test').scr="vqsol_small.gif" then document("Test").scr="Newimg.gif" > > > > <DIV STYLE="Position : Absolute ;Left: 320px; Top : 01px; Width : 400px"> > > <img NAME="Test" src="VQSol_Small.gif" width="80" height="50"> > > </DIV> > > > > this wont work can someone tell me if this can be done in vbscript? if so > > can someone help me please. > > Regards > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: How to change img scr in vbscript vqthomf schrieb: Quote: > the error I get is object doen't support this property or method: 'Test.scr' > Thanks for your help > > "M Piceni" wrote: > Quote: >> Hi, >> >> try changing NAME="Test" with ID="Test", then use: >> If Test.scr="vqsol_small.gif" Then Test.scr="Newimg.gif" >> >> Massimo. >> >> "vqthomf" <vqthomf@xxxxxx> ha scritto nel messaggio >> news:68898DC2-5956-499A-877A-AF604349EC69@xxxxxx Quote: >>> Hi I am trying to change the img scr in code by using the if document, >>> ('Test').scr="vqsol_small.gif" then document("Test").scr="Newimg.gif" >>> >>> <DIV STYLE="Position : Absolute ;Left: 320px; Top : 01px; Width : 400px"> >>> <img NAME="Test" src="VQSol_Small.gif" width="80" height="50"> >>> </DIV> >>> >>> this wont work can someone tell me if this can be done in vbscript? if so >>> can someone help me please. >>> Regards >> |
My System Specs![]() |
| | #5 (permalink) |
| | Re: How to change img scr in vbscript I have tried this and I still get the same error, what I am trying to do is we have a submit button to copy file from a server to a small handheld sort of laptop which is working but it is slow I need to indicate that it is working. I was going to show an moving image and the file copy has finished show blank image. Regards "ekkehard.horner" wrote: Quote: > vqthomf schrieb: Quote: > > the error I get is object doen't support this property or method: 'Test.scr' > > Thanks for your help > > > > "M Piceni" wrote: > > Quote: > >> Hi, > >> > >> try changing NAME="Test" with ID="Test", then use: > >> If Test.scr="vqsol_small.gif" Then Test.scr="Newimg.gif" > >> > >> Massimo. > >> > >> "vqthomf" <vqthomf@xxxxxx> ha scritto nel messaggio > >> news:68898DC2-5956-499A-877A-AF604349EC69@xxxxxx > >>> Hi I am trying to change the img scr in code by using the if document, > >>> ('Test').scr="vqsol_small.gif" then document("Test").scr="Newimg.gif" > >>> > >>> <DIV STYLE="Position : Absolute ;Left: 320px; Top : 01px; Width : 400px"> > >>> <img NAME="Test" src="VQSol_Small.gif" width="80" height="50"> > >>> </DIV> > >>> > >>> this wont work can someone tell me if this can be done in vbscript? if so > >>> can someone help me please. > >>> Regards > >> > >> > |
My System Specs![]() |
| | #6 (permalink) |
| | Re: How to change img scr in vbscript vqthomf wrote: Quote: > the error I get is object doen't support this property or method: > 'Test.scr' Thanks for your help > > "M Piceni" wrote: > Quote: > > Hi, > > > > try changing NAME="Test" with ID="Test", then use: > > If Test.scr="vqsol_small.gif" Then Test.scr="Newimg.gif" > > > > Massimo. > > > > "vqthomf" <vqthomf@xxxxxx> ha scritto nel > > messaggio news:68898DC2-5956-499A-877A-AF604349EC69@xxxxxx Quote: > > > Hi I am trying to change the img scr in code by using the if > > > document, ('Test').scr="vqsol_small.gif" then > > > document("Test").scr="Newimg.gif" > > > > > > <DIV STYLE="Position : Absolute ;Left: 320px; Top : 01px; Width : > > > 400px"> <img NAME="Test" src="VQSol_Small.gif" width="80" > > > height="50"> </DIV> > > > > > > this wont work can someone tell me if this can be done in > > > vbscript? if so can someone help me please. > > > Regards > > > > follows: <html> <head> <title>Test</title> </head> <script Language="VBScript"> Sub BImg_OnClick If InStr(Test.src,"pic1.gif") Then Test.src="pic2.gif" Else Test.src="pic1.gif" End If End Sub </script> <body> <input type="button" value="ChImg" name="BImg"><br><br> <img id="Test" src="pic1.gif"> </body> </html> Clicking on the ChImg button cycles between the 2 images. - First note: use the InStr instead of = because, despite how you write it, the SRC property always returns full path. -Second Note: be sure not to use TEST as an ID for any othe element in the HTML page. This will not cause any evident error, but the behaviour is unpredictable. Massimo. -- |
My System Specs![]() |
| | #7 (permalink) |
| | Re: How to change img scr in vbscript That worked Thanks for your help it's much appreciated. Regards "MassimoP" wrote: Quote: > vqthomf wrote: > Quote: > > the error I get is object doen't support this property or method: > > 'Test.scr' Thanks for your help > > > > "M Piceni" wrote: > > Quote: > > > Hi, > > > > > > try changing NAME="Test" with ID="Test", then use: > > > If Test.scr="vqsol_small.gif" Then Test.scr="Newimg.gif" > > > > > > Massimo. > > > > > > "vqthomf" <vqthomf@xxxxxx> ha scritto nel > > > messaggio news:68898DC2-5956-499A-877A-AF604349EC69@xxxxxx > > > > Hi I am trying to change the img scr in code by using the if > > > > document, ('Test').scr="vqsol_small.gif" then > > > > document("Test").scr="Newimg.gif" > > > > > > > > <DIV STYLE="Position : Absolute ;Left: 320px; Top : 01px; Width : > > > > 400px"> <img NAME="Test" src="VQSol_Small.gif" width="80" > > > > height="50"> </DIV> > > > > > > > > this wont work can someone tell me if this can be done in > > > > vbscript? if so can someone help me please. > > > > Regards > > > > > > > > > > Quite strange, is working for me. My complete HTML file > follows: > > <html> > <head> > <title>Test</title> > </head> > > <script Language="VBScript"> > Sub BImg_OnClick > If InStr(Test.src,"pic1.gif") Then > Test.src="pic2.gif" > Else > Test.src="pic1.gif" > End If > End Sub > </script> > > <body> > <input type="button" value="ChImg" name="BImg"><br><br> > <img id="Test" src="pic1.gif"> > </body> > </html> > > Clicking on the ChImg button cycles between the 2 images. > > - First note: use the InStr instead of = because, despite > how you write it, the SRC property always returns full > path. > > -Second Note: be sure not to use TEST as an ID for any > othe element in the HTML page. This will not cause any > evident error, but the behaviour is unpredictable. > > Massimo. > -- > > |
My System Specs![]() |
| | #8 (permalink) |
| | Re: How to change img scr in vbscript vqthomf wrote: Quote: > That worked Thanks for your help it's much appreciated. > Regards > > "MassimoP" wrote: > Quote: > > vqthomf wrote: > > Quote: > > > the error I get is object doen't support this property or method: > > > 'Test.scr' Thanks for your help > > > > > > "M Piceni" wrote: > > > > > > > Hi, > > > > > > > > try changing NAME="Test" with ID="Test", then use: > > > > If Test.scr="vqsol_small.gif" Then Test.scr="Newimg.gif" > > > > > > > > Massimo. > > > > > > > > "vqthomf" <vqthomf@xxxxxx> ha scritto nel > > > > messaggio > > > > news:68898DC2-5956-499A-877A-AF604349EC69@xxxxxx > > > > > Hi I am trying to change the img scr in code by using the if > > > > > document, ('Test').scr="vqsol_small.gif" then > > > > > document("Test").scr="Newimg.gif" > > > > > > > > > > <DIV STYLE="Position : Absolute ;Left: 320px; Top : 01px; > > > > > Width : 400px"> <img NAME="Test" src="VQSol_Small.gif" > > > > > width="80" height="50"> </DIV> > > > > > > > > > > this wont work can someone tell me if this can be done in > > > > > vbscript? if so can someone help me please. > > > > > Regards > > > > > > > > > > > > > > Quite strange, is working for me. My complete HTML file > > follows: > > > > <html> > > <head> > > <title>Test</title> > > </head> > > > > <script Language="VBScript"> > > Sub BImg_OnClick > > If InStr(Test.src,"pic1.gif") Then > > Test.src="pic2.gif" > > Else > > Test.src="pic1.gif" > > End If > > End Sub > > </script> > > > > <body> > > <input type="button" value="ChImg" name="BImg"><br><br> > > <img id="Test" src="pic1.gif"> > > </body> > > </html> > > > > Clicking on the ChImg button cycles between the 2 images. > > > > - First note: use the InStr instead of = because, despite > > how you write it, the SRC property always returns full > > path. > > > > -Second Note: be sure not to use TEST as an ID for any > > othe element in the HTML page. This will not cause any > > evident error, but the behaviour is unpredictable. > > > > Massimo. > > -- > > > > wrote SCR instead of SRC. Sorry, I didn't notice before, and also dummy copied in my first post, so that also my "solution" was affected by the same bug :-( Ekkehard.Horner made me notice it. Massimo. -- |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Change a Javascript code to VBScript | VB Script | |||
| VBScript to Change only "maximum password age" in Local User Accou | VB Script | |||
| How to do No hang up VBScript (nohup for VBScript) | VB Script | |||
| Column Settings in Windows Live Mail Folders - change one, change | Live Mail | |||
| Change IDE to AHCI, is seen as harware change, so reactivate Vista | Vista account administration | |||