Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

form submital...

Posted on 2000-03-25
3
Medium Priority
?
343 Views
Last Modified: 2006-11-17
This may sound like I'm simple, but im going to ask anyway...

I have a form, that I want to put an image into as an image type.  On_click it opens a new window that has some text.  the new window itself closes on_blur.  My problem is that if I dont give the form itself an action, it submits to itself when the user clicks the input image.

<form name = 'myForm'>
<input type = 'image' src = 'fooBar.jpg' onclick = 'window.open('Cart.asp?prodID=1','cart','width=200,height=300')'>
</form>

I could probably write a script to do this (havent really thought about it), but I am not building the pages, just fixing them, and I have hundreds of these to change.  so for times sake I am really trying to minimize the changes I'm making to each individual page.  which is why i am using the form.

basically i just need to know is it possible to have an image input type that doesnt submit the form?  and without another anchor on it?

Thanks!
0
Comment
Question by:Hooligan
[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
3 Comments
 
LVL 2

Accepted Solution

by:
HolySpirit earned 345 total points
ID: 2657764
Hooligan,
Try this :
<form name = 'myForm'>
<img src = 'fooBar.jpg' onclick = 'window.open('Cart.asp?prodID=1','cart','width=200,height=300')'>
</form>

So the form won't submit while user click the image ...

-- Holy Spirit
0
 
LVL 19

Expert Comment

by:daveamour
ID: 2657776
<Input Type="Image".... submits the form

thats what it does

cant change that

If you dont specify an action in the Form tag it assumes its submitting to itself

You could write an onSubmit Javascript function to trap the submission and take control

Dave
0
 
LVL 8

Expert Comment

by:jbirk
ID: 2660700
Example of what Dave said:
<form name = 'myForm' onSubmit="return false;">


-Josh
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

670 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