473,756 Members | 6,250 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Very simple question on Javascript with ASP button

Hi guys,

I searched around without any clear answer. Tons of stuff, but nothing concrete.

I am trying to call this Javascript function:

function ButtonClicked()
{
alert("The button has been clicked.");
}

Calling it from an HTML button is no problem at all. But there is no way I can call that function from an ASP button. I tried from the HTML side or the aspx side.

I understood that an ASP button run only on the server. But I can't believe you can't make that simple call. I really hate to use HTML button when the design with ASP on a Web Form is so fast and easy.

Since I am a newbie, some code example will be appreciated.

Briefly, I have an ASP button that I want to call the Javascript function "ButtonClic ked"

Thanks

Frag

Jul 20 '05
11 4655
Randy Webb <hi************ @aol.com> writes:

[ if (a=b) in JS1.2]
Its a bug in the if conditional in javascript1.2 specifically.
I like to think so too, but I guess it was considered a "feature".
I.e., it was deliberate. Good thing it was stopped in time!
As far as I know, if (a=b) will always result in true in modern
browsers (the exception would be if a was read only).


.... or if b counts as false.
Try
var a=42;
var b=0;
if (a=b) {} else {alert("b false or JS 1.2 in effect");}

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #11
Lasse Reichstein Nielsen wrote:
Randy Webb <hi************ @aol.com> writes:

[ if (a=b) in JS1.2]
Its a bug in the if conditional in javascript1.2 specifically.

I like to think so too, but I guess it was considered a "feature".
I.e., it was deliberate. Good thing it was stopped in time!


Netscape 4 was enough to drive a teetotaler to drink and an atheist to
religion. Yes, its a very good thing it was stopped :)

As far as I know, if (a=b) will always result in true in modern
browsers (the exception would be if a was read only).

.... or if b counts as false.
Try
var a=42;
var b=0;
if (a=b) {} else {alert("b false or JS 1.2 in effect");}


Yikes! Just when I thought I had it figured out, they type convert on
me. Sheesh. I think I will just stick to == and be happy :)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #12

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

Similar topics

1
1572
by: Keiron Waites | last post by:
Ok to understand what I'm doing you'll have to load the HTML file attached (code also below): When you select an item on the left and select the ">>" button, some alerts will come up telling you what's happening. The first 2 alerts will tell you which items are being added to the array arrayFbox. arrayFbox is a multidimensional array. The values being added are the 2 items that you did not select from the left box. Next, you will get...
5
3108
by: Digital Puer | last post by:
I have the following HTML form: - radio button A (default selected) - radio button B - input field, of type "file" with "Choose" button - submit button I would like to have it so that if the user clicks on the "Choose" button of the input field (to select a file on the local disk), then radio button B is automatically
0
1893
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I have run into is that the emitted html at the end of the process is slightly different and doesn't work. Please don't be put off by all the source code. All the guts are in this first base class, and it doesn't do much. The rest is trivial...
6
2302
by: Marc | last post by:
How could I directly trigger a very simple on localhost and a known port listening server from my internet browser client? Local host means the little server would be running on the client machine, where my browser resides. Browser would be IE, O.S. Windows 2000 or XP, and it's for an intranet application. The goal of the little server on the localhost client side would be to trigger a scanner, with the TWAIN library. Also this server is...
27
4621
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res = $doc->loadHTMLFile("./aBasicSearchResult.html"); if ( $res == true ) { $zip = $doc->getElementById('zipRaw_id')->value; if ( 0 != $zip ) {
2
8374
by: Evan | last post by:
Hey, I posted this yesterday, but no one had any ideas? C'mon now, I know this isn't that hard, i'm just a little new to javascript, and I can't quite figure this out. I searched and searched to try and find the answer to this, but I had no luck anywhere. It's a little different situation than I found anywhere else. I would simply put javascript into the <a> tag, but like I said, It's delivered via PHP, and I don't have access to it. I...
29
1701
by: Knut Olsen-Solberg | last post by:
I try to change the text in a <p> using getElementById(). I wonder what properties exists, and which one to use here. (The following does not work.) Regards Knut ______________________ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>JavaScript</TITLE>
24
6341
by: firstcustomer | last post by:
Hi, Firstly, I know NOTHING about Javascript I'm afraid, so I'm hoping that someone will be able to point me to a ready-made solution to my problem! A friend of mine (honest!) is wanting to have on his site, a Javascript Calculator for working out the cost of what they want, for example: 1 widget and 2 widglets = £5.00
0
9303
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9117
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8542
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7078
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4955
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3141
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2508
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.