Solved

Buttons and html

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

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 …
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 automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

910 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

21 Experts available now in Live!

Get 1:1 Help Now