Solved

Buttons and html

Posted on 2004-08-01
3
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

Question has a verified solution.

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

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…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

635 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