use an anchor to submit, or set image for submit button

M

mikezx10

I am trying to be consistant in display but I wrote code using a
submit button where the rest of the site uses an anchor & href with an
image.

old code
<a href="#"
onclick="javascript:window.frames('Cnt').ValidateForm();"><img src="../
images/go.gif" border="0"></a>

new code
<input type="submit" value="Go" />
 
D

Dooza

I am trying to be consistant in display but I wrote code using a
submit button where the rest of the site uses an anchor& href with an
image.

old code
<a href="#"
onclick="javascript:window.frames('Cnt').ValidateForm();"><img src="../
images/go.gif" border="0"></a>

new code
<input type="submit" value="Go" />

And the question is???

Let me try to guess, you want the client side validation script to fire
when you submit the form? Try

<form name="blah" action="blag" method="blah"
onsubmit="javascript:window.frames('Cnt').ValidateForm();">

Dooza
 
M

mikezx10

And the question is???

Let me try to guess, you want the client side validation script to fire
when you submit the form? Try

<form name="blah" action="blag" method="blah"
onsubmit="javascript:window.frames('Cnt').ValidateForm();">

Dooza

I see my post was not clear, I used a button, but that didnt look at
all like the image, i wanted to know how to submit with the <A> tag so
I could use the same link.

When i use the link i dont think the same process is followed as with
a submit button


I just started with classic asp & Javasript, can you tell me what
"javascript:window.frames('Cnt').ValidateForm();" does? How does it
validate a form, i dont see any validation logic
 
D

Dooza

I see my post was not clear, I used a button, but that didnt look at
all like the image, i wanted to know how to submit with the<A> tag so
I could use the same link.

Its still not really clear, especially since this group doesn't cater
for client side scripting.
When i use the link i dont think the same process is followed as with
a submit button

Thats correct, the onsubmit event doesn't fire when you don't you use a
button with the type set to submit.
I just started with classic asp& Javasript, can you tell me what
"javascript:window.frames('Cnt').ValidateForm();" does? How does it
validate a form, i dont see any validation logic

That code doesn't make any sense to me, it might even be ASP.NET which
is certainly not on topic here.

There is loads of form validation scripts/examples out there, just
google it and see.

Good luck!

Steve
 
A

Adrienne Boswell

Gazing into my crystal ball I observed (e-mail address removed) writing in
a

I see my post was not clear, I used a button, but that didnt look at
all like the image, i wanted to know how to submit with the <A> tag so
I could use the same link.

It's not advisable. You need client side script to do it, and if the
client does not have Javascript enabled, your link will not submit.

Why not use a plain submit button? People are used to having one, and
could even be confused if it is not there. If you are so intent on using
a graphic submit button, you can use <input type="image"
src="yourbutton.png" height="x" width="x" alt="Submit Form">, or you
could style an input button using CSS.

I would post to an HTML group, like alt.html for more information on this
- it is off topic here.
When i use the link i dont think the same process is followed as with
a submit button


I just started with classic asp & Javasript, can you tell me what
"javascript:window.frames('Cnt').ValidateForm();" does? How does it
validate a form, i dont see any validation logic

This is off-topic for this group. I suggest you head on over to
comp.languages.javascript and ask over there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,794
Messages
2,569,641
Members
45,355
Latest member
SJLChristi

Latest Threads

Top