473,772 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

submit button with image question

In the following code, I have 2 questions regarding submit button with
image.

1) Does this code <input type="image" name="populate" src="populate.g if">
behave the same as an HTML submit button with image populate.gif?
When I click p1 or p2 button, it will post the page to process.asp.

2) When I check the checkbox, I want the image in submit button change
from populate.gif to validate.gif. Unfortunately, the code
InputForm.p2.sr c = "validate.g if"; doesn't work. But
InputForm.p1.va lue = "validate button"; is working for a regular HTML submit
button.

Any workarounds? Please advise. Thanks!!

<html>
<head>
<script type="text/javascript">
function cb_onClick()
{ if (InputForm.C1.c hecked == true) //NOT InputForm.C1.va lue == "on"
{
InputForm.p1.va lue = "validate button";
InputForm.p2.sr c = "validate.g if";
}
else
{
InputForm.p1.va lue = "populate button";
InputForm.p2.sr c = "populate.g if";
}
}
</script>
</head>
<body>
<form name="InputForm " method="POST" action="process .asp">
<p><input type="checkbox" name="C1" onClick="cb_onC lick()"></p>
<p><input type="submit" name="p1" value="populate button">
<p><input type="image" name="p2" src="populate.g if">
</form>
</body>
</html>
Jul 19 '05 #1
3 1714
No but here's a workaround that has worked for me:

<input type="image" src="myimage.gi f"
onclick="docume nt.frmMain.Butt onName.value =
'btnProcess';do cument.frmMain. submit();">

Best regards,
J. Paul Schmidt, Freelance ASP Web Designer
http://www.Bullschmidt.com
ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #2
btnProcess is the function to change the image? But how to change the image?

"Bullschmid t" <pa**@bullschmi dt.com-nospam> wrote in message
news:ee******** ******@TK2MSFTN GP09.phx.gbl...
No but here's a workaround that has worked for me:

<input type="image" src="myimage.gi f"
onclick="docume nt.frmMain.Butt onName.value =
'btnProcess';do cument.frmMain. submit();">

Best regards,
J. Paul Schmidt, Freelance ASP Web Designer
http://www.Bullschmidt.com
ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #3
<<
But how to change the image?


Well if you're posting to the same page then perhaps change this:
<input type="image" src="myimage.gi f"
onclick="docume nt.frmMain.Butt onName.value =
'btnProcess';do cument.frmMain. submit();">

To be more like this instead:
<input type="image" src="<%= ImageNameVariab le %>"
onclick="docume nt.frmMain.Butt onName.value =
'btnProcess';do cument.frmMain. submit();">

Otherwise perhaps ask on a JavaScript or DHTML board...

Best regards,
J. Paul Schmidt, Freelance ASP Web Designer
http://www.Bullschmidt.com
ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6589
by: Nicolas Keller | last post by:
Hi! I'm used to have Mozilla for testing my PHP sites when I'm coding. The site's nearly finished, now I've made a test with the Internet Exlporer... guess what... failed. The problem: I'm using a form that submit's (POST) its data via three different image buttons (depending on which button you click, something different should happen):
4
2409
by: Ice Man | last post by:
Hi all How Can I submit a form by clicking on an image instead of the submit button? Thanks
6
5683
by: Adrian | last post by:
I need to have 2 submit buttons in one form calling the same page. I just need to know which was used. Being able to pass a hidden form input for each would be ideal. How can I do this?? Thanks!,Adrian
3
4344
by: John Dunlop | last post by:
(Note crosspost and follow-ups to ciwah.) Nicolas Keller wrote in thread "Differences in form handling btw Mozilla and IE?": > The problem: I'm using a form that submit's (POST) its data via three > different image buttons (depending on which button you click, > something different should happen): > > <form action="id.php" method="post" name="form2">
2
3508
by: Matt | last post by:
In the following code, I have 2 questions regarding submit button with image. 1) Does this code <input type="image" name="populate" src="populate.gif"> behave the same as an HTML submit button with image populate.gif? When I click p1 or p2 button, it will post the page to process.asp. 2) When I check the checkbox, I want the image in submit button change from populate.gif to validate.gif. Unfortunately, the code InputForm.p2.src =...
5
2803
by: Steve JORDI | last post by:
Just a question using images as submit buttons and PHP4.4.4. It seems that my code correctly works in FireFox but not in IExplorer. For example, I have a FORM with 2 buttons called "search" and "save". In a second file, the one mentioned in the "action" parameter, I test which button has been clicked in order to decide which action to take. IExplorer doesn't get anything, FireFox correctly works.
4
6676
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all I have the following code: I am trying to use the value of the image button to evaluate what plan the user has chosen, i.e. it request("submit1")="Basic", then the user chose basic plan ... But when I click one of the image button, the thing is different from what I thought. it seems that it has field name like submit1.x=24&submit1.y=10, looks like the form submit swith the image button position values instead of the value
10
8617
by: The Natural Philosopher | last post by:
I am coding up a bit of javascript stuff, and have managed to stumble my way through most of what I want.. But this one has got me stumped. I call submit() and get a javascript error 'Submit not defined' in Firefox.. My very expensive javascript Bible assures me its built in ..so where oh where have I FSCKED up?
2
1428
by: Mtek | last post by:
Hi, In the PHP form for my company, they use an image button to submit the form to some javascript for validation, then use the SUBMIT() to submit the form. The code is this: <TD class="topnav" bgcolor="#00FF00"><a href="savedata.php" onclick="if ('preventDefault' in event) { event.preventDefault(); } else { event.returnValue = false; }
7
1950
by: Petr Vileta \(fidokomik\) | last post by:
I have a form with few text inputs. Every text input is followed by image type input. In this form I want to have 1 submit button on the top. A problem I want to resolve is: when user type something into text input and press enter then I want to submit form by image type button but not by submit button. I tried to use tabindex parameter but this not work as I expect. Any idea? Code example:...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.