scripter73
Programmer
Hi,
This seems like a relatively simple question, but I still don’t know the answer.![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Here’s my goal:
Submit my HTML form with a customized submit button that is an image. Before submitting, however, I want to perform a Javascript function that verifies a form field (for blankness, etc.) It’s important to execute that JS.
Here’s what I have. I have 2 buttons that I am comparing side by side. I only need one and I'm trying to figure out the best one to use:
1) <img type=”image” src=”images/submitButton.gif” width=70 height=20 onlick=”document.Entry.submit();”><br><br>
Problem here is this doesn’t execute the way I want by calling the function, it just submits form no matter what, but it looks good.
2) <input type=”image” name=”Submit” value=”Submit” src=”images/submitButton.gif” width=70 height=20><br><br>
It executes exactly the way I want, but the problem is the image is distorted (bigger than the other one) even though it’s the same graphic. When it’s clicked, the onsubmit in the <form> executes properly.
I don’t know how I can merge the “behavior” and “look” of these two buttons into one.
Here is my entire form:
<form name="AcctEntry" action="Status.html" method="post" onsubmit="return verify(this);">
<input name="AcctNumber" type="text" size="20" maxlength="20"><br><br>
<img type="image" src="images/submitButton.gif" alt="submit" width="69" height="17" border="0" onclick="document.AcctEntry.submit();"> Button1
<input type="image" name="Submit" value="Submit" src="images/submitButton.gif"><br><br> Button2
</form>
Please help.
Any help is appreciated.
Thanks,
Scripter73
Change Your Thinking, Change Your Life.
This seems like a relatively simple question, but I still don’t know the answer.
Here’s my goal:
Submit my HTML form with a customized submit button that is an image. Before submitting, however, I want to perform a Javascript function that verifies a form field (for blankness, etc.) It’s important to execute that JS.
Here’s what I have. I have 2 buttons that I am comparing side by side. I only need one and I'm trying to figure out the best one to use:
1) <img type=”image” src=”images/submitButton.gif” width=70 height=20 onlick=”document.Entry.submit();”><br><br>
Problem here is this doesn’t execute the way I want by calling the function, it just submits form no matter what, but it looks good.
2) <input type=”image” name=”Submit” value=”Submit” src=”images/submitButton.gif” width=70 height=20><br><br>
It executes exactly the way I want, but the problem is the image is distorted (bigger than the other one) even though it’s the same graphic. When it’s clicked, the onsubmit in the <form> executes properly.
I don’t know how I can merge the “behavior” and “look” of these two buttons into one.
Here is my entire form:
<form name="AcctEntry" action="Status.html" method="post" onsubmit="return verify(this);">
<input name="AcctNumber" type="text" size="20" maxlength="20"><br><br>
<img type="image" src="images/submitButton.gif" alt="submit" width="69" height="17" border="0" onclick="document.AcctEntry.submit();"> Button1
<input type="image" name="Submit" value="Submit" src="images/submitButton.gif"><br><br> Button2
</form>
Please help.
Any help is appreciated.
Thanks,
Scripter73
Change Your Thinking, Change Your Life.