Solved

Buttons and html

Posted on 2004-08-01
3
179 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 33

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

829 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