473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

set a asp variable with a value in Javascript

How can i set a asp variable with a value in Javascript?

JS Code:

<script language="JavaScript" type="text/javascript">
<!--

if (acrobat.ver5)
{
// if Acrobat 5.0 or newer is installed, do Acrobat 5.0 stuff.
document.write("Acrobat V5 + is installed")
var installed_pdf = "<%inst_pdf=yes%>"
}
else if (acrobat.installed)
{
// do older Acrobat stuff
document.write(acrobat.version);
}
else
{
// Acrobat is NOT installed. Do something else.
document.write("Acrobat is NOT installed.")
}

//-->
</script>

ASP Code:

<% response.write "Installed PDF = " & inst_pdf & "<br>" %>

This doesnt seem to work.
Jul 23 '05 #1
5 2022
"Picco" <cr******@aol.com> wrote in message
news:93*************************@posting.google.co m...
How can i set a asp variable with a value in Javascript?

JS Code:

<script language="JavaScript" type="text/javascript">
<!--

if (acrobat.ver5)
{
// if Acrobat 5.0 or newer is installed, do Acrobat 5.0 stuff.
document.write("Acrobat V5 + is installed")
var installed_pdf = "<%inst_pdf=yes%>"
}
else if (acrobat.installed)
{
// do older Acrobat stuff
document.write(acrobat.version);
}
else
{
// Acrobat is NOT installed. Do something else.
document.write("Acrobat is NOT installed.")
}

//-->
</script>

ASP Code:

<% response.write "Installed PDF = " & inst_pdf & "<br>" %>

This doesnt seem to work.


ASP executes before client-side JavaScript.

Perhaps all you want (inside your script) is:

document.write "Installed PDF = " & inst_pdf;
Jul 23 '05 #2
> ASP executes before client-side JavaScript.

Perhaps all you want (inside your script) is:

document.write "Installed PDF = " & inst_pdf;


Can it not be done?

I've tried runat=server.

doesnt work.

Jul 23 '05 #3
I now have this code:

<script language="JavaScript" type="text/javascript">
if (acrobat.ver5)
{
// if Acrobat 5.0 or newer is installed, do Acrobat 5.0 stuff.
//document.write("Acrobat V5 + is installed")
}
else if (acrobat.installed)
{
// do older Acrobat stuff
//document.write(acrobat.version);
}
else
{
// Acrobat is NOT installed. Do something else.
//document.write("Acrobat is NOT installed.")
question = confirm("You do not have Adobe Acrobat Reader Installed on
your system. \n\nClick OK to download this software now. Click Cancel
to go Back")
if (question !="0"){
top.location =
'http://ardownload.adobe.com/pub/adobe/reader/win/7x/7.0/enu/AdbeRdr70_enu_full.exe'
}
if (question =="0"){
history.back()
}

}
</script>

However, if you click the 'OK' button then when the 'File Download'
dialgoue Windows box appear should you click Cancel then i am just left
with a white screen.

what i want is if cancel is clicked then return to the previous page (
a history.back) or something???

Jul 23 '05 #4
In article <11*********************@z14g2000cwz.googlegroups. com>,
cr******@aol.com enlightened us with...
question = confirm("You do not have Adobe Acrobat Reader Installed on
your system. \n\nClick OK to download this software now. Click Cancel
to go Back")
The confirm function returns boolean.

Better:
doInstall = confirm("Want it?");
if (doInstall)
{
// do something
}
else
{
// do something else
}

However, if you click the 'OK' button then when the 'File Download'
dialgoue Windows box appear should you click Cancel then i am just left
with a white screen.


Not much you can do about that, really, because you can't catch the click on
Cancel there.
In fact, you'll still have a blank screen once the user downloads the file,
won't you?

Why don't you simply tell the user they need to install it and provide a
link? That's what other sites do.
If you embed the document, you might be able to make the browser prompt for
the plugins. That happens with Flash. I don't do acrobat, so I'm not sure if
it's the same.

--
--
~kaeli~
Time flies like an arrow. Fruit flies like a banana.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5
move the javascript field to a hidden form field (<input type=hidden>)
and then use Request.Form (or Request.querystring, whatever) to get it.

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: R.G. Vervoort | last post by:
I am using a javafunction (onclick in select) in which i am calling a function in php (thats why i send this to both php and javascript newsgroups). in the onclick i call the function...
7
by: Jonas Daunoravicius | last post by:
The subject pretty much sums up what I need to do. Here is what I have so far, but still can't figure out how to get it working: <script language="javascript" type="text/javascript"> function...
7
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script...
5
by: Jim Banks | last post by:
Greetings I'm opening a pop up window with a html form, (in one document) and I want to pass a variable to the html form called from the hyperlink. Here's the code I'm using to pop up the...
2
by: umashd | last post by:
Hi, I am doing a web based project for my graduation. I studied bit of java for backend processesing and javascript for the client. Here is the scenario. In the FORM, I use INPUT TYPE=text...
16
by: sneill | last post by:
How is it possible to take the value of a variable (in this case, MODE_CREATE, MODE_UPDATE, etc) and use that as an object property name? In the following example I want 'oIcon' object to have...
23
by: Russ Chinoy | last post by:
Hi, This may be a totally newbie question, but I'm stumped. If I have a function such as: function DoSomething(strVarName) { ..... }
1
by: stephane | last post by:
I have a problem which must be in this : print" <script type='text/javascript'> document.location.replace('http://127.0.0.1/add_task.php?req_id={$maxValue}&tk_request_name={$req_name}');...
0
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I want to display a progress bar on my web page. I have this code for progress bar in javascript in my web page. I have a button on the web page, if someone clicks that button...
1
pbmods
by: pbmods | last post by:
VARIABLE SCOPE IN JAVASCRIPT LEVEL: BEGINNER/INTERMEDIATE (INTERMEDIATE STUFF IN ) PREREQS: VARIABLES First off, what the heck is 'scope' (the kind that doesn't help kill the germs that cause...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.