Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 8th, 2005, 08:52 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default 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.


www.crmpicco.co.uk
www.milklemonadechocolate.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
Reply With Quote
  #2 (permalink)  
Old March 8th, 2005, 09:10 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii Crimpicco

Can you tell me about
 var installed_pdf = "<%inst_pdf=yes%>"

<%inst_pdf=yes%>???
check it may be something you are missing here

Hope this will help you


Cheers :)

vinod
Reply With Quote
  #3 (permalink)  
Old March 9th, 2005, 08:49 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

This doesnt work:

<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")
    <%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.")
    <%inst_pdf='"no"'%>
}

</script>

any ideas?

www.crmpicco.co.uk
www.milklemonadechocolate.uk.tt
Reply With Quote
  #4 (permalink)  
Old March 9th, 2005, 08:59 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

If Acrobat is not installed then
"Acrobat is NOT installed"
appears correctly.

If Acrobat is installed then
"Acrobat V5 + is installed"
appears correctly.

However, the setting of the variables to go with these conditions does not work.

If Acrobat IS installed i want the ASP variable inst_pdf="yes".
If Acrobat is NOT installed i want the ASP variable inst_pdf="no".

Then i want to use the value of this variable in my ASP page:

<form name="form" method="post" action="reg_confirm.asp" onSubmit="return checkme();">
<div align="center">
<b>Picco User Agreement</b>
</div>
<%
'inst_pdf="no"
response.write "Installed PDF = " & inst_pdf & "<br>"
%>
<table align="center">
<tr>
<% if inst_pdf = "yes" then %>
<td align="center">
Click the Print button to Print the Picco Terms & Conditions
</td>
<% else %>
<td align="center">&nbsp;</td>
<% end if %>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<% if inst_pdf = "yes" then %>
<td align="center"><iframe src="../PICCOCLICKWRAP15.pdf" width="600" height="600" scrolling="yes" name="content" class="body"></iframe></td>
<% end if %>
<% if inst_pdf = "no" then %>
<td align="center"><iframe src="get_acrobat.asp" width="600" height="500" scrolling="yes" name="content" class="body"></iframe></td>
<% end if %>
</tr>
<br>
<% if inst_pdf = "yes" then %>
<tr><td align="center">
<input type="checkbox" name="agree" id="agree" value="agree_terms">
Agree to Terms & Conditions<br>
</td></tr>
<tr><td align="center">
<input type="submit" name="accept" id="accept" value="Accept" onMouseOver="style.cursor='hand'">&nbsp;&nbsp;&nbs p;
<input type="button" name="reject" id="reject" value="Reject" onMouseOver="style.cursor='hand'" onClick="return areyousure();">&nbsp;&nbsp;&nbsp;
</td>
</tr>
<% else %>
<tr>
<td align="center">
<input type="button" name="back" id="back" value="Back" onMouseOver="style.cursor='hand'" onClick="history.back()">
</td>
</tr>
<% end if %>
</table>
<input type="hidden" name="forename" id="forename" value="<%=forename%>">
<input type="hidden" name="surname" id="surname" value="<%=surname%>">
<input type="hidden" name="comp_name" id="comp_name" value="<%=comp_name%>">
<input type="hidden" name="position" id="position" value="<%=position%>">
<input type="hidden" name="email" id="email" value="<%=email%>">

<input type="hidden" name="agencyid" id="agencyid" value="<%=agency_id%>">
<input type="hidden" name="agentid" id="agentid" value="<%=agent_id%>">
<input type="hidden" name="username" id="username" value="<%=user_name%>">
<input type="hidden" name="password" id="password" value="<%=pass_word%>">
</form>

What am i doing wrong?


www.crmpicco.co.uk
www.milklemonadechocolate.uk.tt
Reply With Quote
  #5 (permalink)  
Old March 11th, 2005, 05:23 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

http://p2p.wrox.com/topic.asp?TOPIC_ID=27630,
check links provided by om_prakash


Cheers :)

vinod
Reply With Quote
  #6 (permalink)  
Old March 11th, 2005, 05:34 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

If you want to check it by a component
they this link help you
http://www.4guysfromrolla.com/webtech/121400-1.2.shtml

Using BrowserHawk to Perform Browser Detection


Cheers :)

vinod
Reply With Quote
  #7 (permalink)  
Old March 11th, 2005, 11:07 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

The complete working script:

<script language="JavaScript" type="text/javascript" src="acrobat.js"></script>
<script language="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 This is required to Print the Terms & Conditions\nClick OK to download this software now. Click Cancel to go Back")
    if (question !="0"){
        top.location = 'get_acrobat.asp'
    }
    if (question =="0"){
        history.back()
    }
}
</script>

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
storing Javascript variable to ASP variable rupen Classic ASP Basics 5 April 10th, 2007 07:06 AM
assign javascript variable to asp variable manjunath_c_k Classic ASP Basics 1 September 14th, 2006 07:35 AM
set a asp variable with a value in Javascript crmpicco Classic ASP Basics 3 March 10th, 2005 10:46 AM
set ASP variable values inside Javascript crmpicco HTML Code Clinic 1 March 9th, 2005 12:32 PM
asp javascript "record set help" terry_s Classic ASP Basics 2 April 19th, 2004 07:46 AM



All times are GMT -4. The time now is 09:43 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.