SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    May 2000
    Location
    Houston, TX
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi I have been trying to figure out this simple thing for 2 days now and I can't get it. I get a run time error when I call the function 'DelArray()' from inside vbscript with a document.write tag. I have tried DelArray with quotes, without quotes, without parentheses, nothing seems to work. Here is the offending code:

    document.write "<Input Type=""button"" ID=""top.ProfileArray(a)"" onclick=""DelArray()"" Value=""Del"">"
    document.write "</TD>"

    I can't think of anything else to do and so I am asking all the experts to give me a 10 second solution. It is probably something amazingly simple. I have looked everywhere here, deja.com, msdn, asptoday, asp101, ....

    Thanks
    Wayne
    airlinefares@hotmail.com


  2. #2
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The code below should do the job for you:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    document.write '&lt;Input Type="button" ID="top.ProfileArray(a)" onclick="DelArray()" Value="Del"&gt;'
    document.write '&lt;/TD&gt;'
    [/code]

    Wherever possible try avoiding the use of dobule quotes (") in VBScript it can be ver messy.

    Can I also ask why you have limited yourself to just IE with the script and not using JavaScript which works with a lot more browsers as well?

    ------------------
    Karl Austin
    KDA Web Services

  3. #3
    SitePoint Member
    Join Date
    May 2000
    Location
    Houston, TX
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Karl I will try this when I get back to work on Monday!

    Yes I agree Jscript is better but I just don't know it and where I work no one else does either they all know VBscript and this is for our intranet and everyone has(must have) IE5. VBscript is easier to learn but also alot more code and I believe bloated. But in a big company (I am new here) you have to conform to standards and then maybe slowly change them. I am going to try and learn more Jscript but time is hard to come by and I spend enough time coding at work. To code more after work is sometimes fun sometimes NOT..if you get my drift. So it will probably be awhile before I get more Jscript and then convince my boss to allow me to use it.

    Thanks Again for responding..this is a really cool site I like the attitude.

    [This message has been edited by eurowayne (edited May 13, 2000).]

  4. #4
    SitePoint Member
    Join Date
    May 2000
    Location
    Houston, TX
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Karl,
    I tried your fix but unfortunately it did not work. However, I found out that when you use document.write it doesn't allow you to see client side script functions. Which is very weird since document.write is called in client side script. To double check I viewed source and all I saw was my document.write statements and nothing else.
    The ggod news is I finally found another guy who knew ASP and he told me to use the innerHTML feature, which I did, and now it works perfectly. Just wanted to keep you updated thanks for the help.

    Wayne

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote/font><HR>Originally posted by Karl:
    The code below should do the job for you:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    document.write '&lt;Input Type="button" ID="top.ProfileArray(a)" onclick="DelArray()" Value="Del"&gt;'
    document.write '&lt;/TD&gt;'
    [/code]

    Wherever possible try avoiding the use of dobule quotes (") in VBScript it can be ver messy.

    Can I also ask why you have limited yourself to just IE with the script and not using JavaScript which works with a lot more browsers as well?

    <HR></BLOCKQUOTE>


  5. #5
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can't use document.write on the server in an ASP script if that is what your trying to do. Client side objects only exist within Internet Explorer so the Scripting Engine on the server can't see them. Use Response.write on the server.

    ------------------
    Wayne Luke - Sitepoint Moderator/Internet Media Developer
    Digital Magician Studios - Making Magic with Web Applications
    wluke@digitalmagician.com


Bookmarks

Posting Permissions

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