The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > Web Programming > DHTML > JavaScript


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Tags:

Closed Thread
 
LinkBack Thread Tools    Display Modes   
  #1 (permalink)  
Old 06-10-2007, 04:13 PM
E.T.
Posts: n/a
[SOLVED] How to call a ASP program form within javascript?

Have a button, and on onClick event, call a javascript function, inside javascript function, what to call a ASP program. Does anyone know how to do it? what is syntax?

Thanks
I already have reset and submit button defined for different actions, so I have added the third button, I want to redirect to a ASP page when this third button get clicked.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #2 (permalink)  
Old 06-10-2007, 04:13 PM
mrgoody
Posts: n/a
using Addattribute.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #3 (permalink)  
Old 06-10-2007, 04:13 PM
Big H
Posts: n/a
i assume you want to call an ASP page... i'd probably do something like openWindows("/mypage.asp"); as your on click event code.. you may want to check the exact synatx of that but it should work.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #4 (permalink)  
Old 06-10-2007, 04:14 PM
country bear
Posts: n/a
ASP is server-side scripting while JavaScript is client-side, so there really isn't a way exactly to call ASP on with an onclick trigger because the page has already been drawn and is static.

however, a work-around could be to have a form who's action is set to an ASP page and then using the following line from javascript you could submit the form that calls the ASP.

even if you did a post back to yourself you at least give the server-side scripting a chance to execute as it re-drew the page.

EXAMPLE:

<%
if request.servervariables( "request_method" ) = "POST" then
'the request_method is a great way to detect if you're
'being posted to or drawing the page for the first time
end if
%>
<html>
<head>
<script language=javascript>
function callASP()
{
document.myform.submit();
}
</script>
</head>
<body>
<form name=myform action=mypage.asp method=post>
<input type=text name=yourMiscTextFields>
<input type=button onclick=javascript:callASP();>
</form>
</body>
</html>

hope this helps! good luck!


***JUST SAW YOUR UPDATE***
you could program your third button as follows:
<input type=button value=Click-Me onclick= javascript:window.navigate( 'pagename.asp' );>

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #5 (permalink)  
Old 06-10-2007, 04:14 PM
anand
Posts: n/a
Not able to get u completely !! Let me try ...

On Button Click u r calling some JavaScript function ..in the fuction...u can call the asp page ..by setting the action to ur asp page !!

Add some more details to ur question ..??

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #6 (permalink)  
Old 06-10-2007, 04:14 PM
d-Bo
Posts: n/a
This doesn't make any sense. You can have javascript on an asp page, but you can't call an asp program from javascript. You can redirect to an asp page. ASP - Active Server Pages - not programs! Come on now

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Closed Thread


Thread Tools
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

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



All times are GMT -7. The time now is 05:50 AM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50