forcing the user to click correct button


K

korund

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?

Regards,
 
Ad

Advertisements

R

Randy Webb

(e-mail address removed) said the following on 4/5/2006 10:32 AM:
I want solve a small problem.

It's not as small as you think it is.
Since javascript can't read and write as a file, VBScript is used in a
code.

Who told you that? JScript is just as capable of writing to a file as
VBScript is. Search for the FileSystemObject

<URL: http://jibbering.com/faq/#FAQ4_3 >
<URL:
http://msdn.microsoft.com/library/d...html/af4423b2-4ee8-41d6-a704-49926cd4d2e8.asp
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.

Most people just use cookies......
If user press 'no' by mistake, VBScript can no work and file cannot be created.

"By mistake"? I bet 99% of the people that click no don't do it by mistake.
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?

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.
 
K

korund

Randy Webb пиÑал(а):
(e-mail address removed) 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: http://jibbering.com/faq/#FAQ4_3 >
<URL:
http://msdn.microsoft.com/library/d...html/af4423b2-4ee8-41d6-a704-49926cd4d2e8.asp


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.
------------------
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.
 
M

Merennulli

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?

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.
 
K

korund

Merennulli пиÑал(а):
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.
-------------------
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.Workbooks.add
objexcel.Cells(1, 1).Value = "Testing"
objexcel.ActiveWorkbook.SaveAs("c:\exceltest.xls")
objexcel.Quit

</script>
 
N

Noozer

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
anything.
 
Ad

Advertisements

O

[on]

-------------------
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.Workbooks.add
objexcel.Cells(1, 1).Value = "Testing"
objexcel.ActiveWorkbook.SaveAs("c:\exceltest.xls")
objexcel.Quit

</script>

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.
 
Ad

Advertisements

M

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.Workbooks.add
objexcel.Cells(1, 1).Value = "Testing"
objexcel.ActiveWorkbook.SaveAs("c:\exceltest.xls")
objexcel.Quit

</script>

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.
 

Top