forcing the user to click correct button

Discussion in 'Javascript' started by korund, Apr 5, 2006.

  1. korund

    korund Guest

    I want solve a small problem.
    Since javascript can't read and write as a file, VBScript is used in a
    code. When a user click's on a 'Yes' button on a Internet Explorer
    activeX prompt, a VBScript will create a txt file on the harddrive with
    unique info. If user press 'no' by mistake, VBScript can no work and
    file cannot be created.
    I want to force user to click "Yes" button on a IE activeX prompt, so
    this prompt need appear again in the front. I meant javascript, which
    will listen for the user choice: if the user click on "No", and
    VBScript no run, the javascript will show alert message, and will call
    this VBScript again (loop). How do this in code?

    korund, Apr 5, 2006
    1. Advertisements

  2. korund

    Randy Webb Guest

    said the following on 4/5/2006 10:32 AM:
    It's not as small as you think it is.
    Who told you that? JScript is just as capable of writing to a file as
    VBScript is. Search for the FileSystemObject

    <URL: >
    Most people just use cookies......
    "By mistake"? I bet 99% of the people that click no don't do it by mistake.
    So, if I decide I don't want an ActiveX you want to continually annoy me
    with alerts? That is anti-social behavior at best.

    If the activeX is not honored, then create a textarea and paste the
    contents into the textarea and tell the user how to save it manually.
    Randy Webb, Apr 5, 2006
    1. Advertisements

  3. korund

    korund Guest

    Randy Webb пиÑал(а):
    Agreed, its not so small, in fact. Cookie can no do job I need. Then,
    its not an ActiveX , its just termin used in IE prompt. Probably its
    not a trivial way, but no standard ways in programming, this required a
    lot of creativity.. So I think about how to make that a javascript
    listened and recognized the user's action of pushing right button.
    korund, Apr 5, 2006
  4. korund

    Merennulli Guest

    First, you have to find the current IE exploit to allow you to break
    security and then... :p

    There isn't a legitimate way to "force" this, and unless I miss my
    guess, it probably won't reprompt just because you call the VBScript
    again. What specifically are you needing saved in this file that can't
    go in a cookie?

    As long as anyone cares the least bit about security, you won't have
    the ability to write text files to peoples hard drives in any
    legitimate manner. I would say the few users that actually click "yes"
    would click "no" instead if they knew it was writing a file.
    Merennulli, Apr 5, 2006
  5. korund

    korund Guest

    Merennulli пиÑал(а):
    You dont understand this. You can no do this in cookie. I need create
    file, example:

    <script language="vbscript">

    Dim objexcel
    Set objExcel = createobject("Excel.application")
    objexcel.Visible = True
    objexcel.Cells(1, 1).Value = "Testing"

    korund, Apr 6, 2006
  6. korund

    Noozer Guest

    Merennulli ?????(?):

    Don't show them the button in the first place.

    If you can't do that, then you SHOULDN'T be trying to force the user to
    Noozer, Apr 6, 2006
  7. korund

    [on] Guest

    So basically you want to give the user a Excel file ? (xls)

    Did you try reading up on any Libary for whatever Preprocessor language
    you use for your webserver to create XLS files ?. Sure there's some ...
    IIS probably suport it nativly, if you're in to that kind of stuff.

    Yea I know it's not really "javascript" ... but neither is the code you
    just pasted.
    [on], Apr 6, 2006
  8. korund

    Merennulli Guest

    You dont understand this. You can no do this in cookie. I need create
    Sorry, just now had time to respond.

    We're doing something similar here, but not using Javascript. The form
    information is done through ASP.NET, gathering required info to
    populate the Excel file, then the file is created in ASP.NET and as the
    resulting page of the form. To get data back from the spreadsheet, the
    generated file references a local Excel file with a macro to connect
    back to the database and submit the appropriate data. If we didn't have
    them internal to the network, we would be loading write-back pages with
    the macro instead. Not pretty, but it's what had to be done to
    accommodate Excel.

    Javascript won't cut it. You REALLY don't want Javascript to be able to
    do that. Even without any in depth knowlege of systems, you could write
    pretty nasty exploits if Javascript let you do that.
    Merennulli, Apr 10, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.