Solved

Buttons and html

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
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 …
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. 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 :…
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…

752 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