Solved

Buttons and html

Posted on 2004-08-01
3
175 Views
Last Modified: 2013-12-23
Hi Folks,
   
   i need some help with buttons. I have a page in which I have the following line of code:

<%Response.Write "<input type=image name=btnCreate src=images/ blue/Report.jpg LANGUAGE=JAVASCRIPT></td>"%>
When I use that way, the button has the mage on it, but nothing happens whne you click on it, my rtn never executes.

So, I thought, okay, make the input type a button, but then I cann't get the image.

I have tried it w/o the <%response.write etc so it looks like this:

<input type=image name="btnCreate" src=images/ blue/Report.jpg LANGUAGE="JAVASCRIPT">

    What I am trying to achieve is if the user clicks on it, I want to execute a snippett of coding (function -if javascript or subroutine -if vbscript..I can write it in either). And I would like to place the image on the button instead of some descriptive text  etc.
As it is now, it doesn't execute the snippet of coding..:-(

What am I doing wrong and how do I correct it??
thanks...
0
Comment
Question by:bearpaws
  • 2
3 Comments
 
LVL 33

Expert Comment

by:hongjun
ID: 11691002
try this

<%Response.Write "<input type=image name=btnCreate src=images/blue/Report.jpg LANGUAGE=JAVASCRIPT></td>"%>


hongjun
0
 
LVL 33

Expert Comment

by:hongjun
ID: 11691005
You have got a space in the src field.

hongjun
0
 
LVL 32

Accepted Solution

by:
Big Monty earned 125 total points
ID: 11697194
if you want to execute a javascript function then you need to add the onclick attribute:

<%Response.Write "<input type=image name=btnCreate src=images/blue/Report.jpg onclick=myFunction();></td>"%>

<script language=javascript>
function myFunction() {
   alert('This works!');
}
</script>

B.D.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now