Jump to content
xisto Community
.hack//GU

About Submit Form Box

Recommended Posts

I make the form tags like this:

<form action="check.php" method="post"><table>  <tr>   <td>Username:</td>   <td><input type="text" name="user"></td> </tr>  <tr>   <td><input type="submit" value="set"></td> </tr></table></form>
my question:
in the tags above, it will produce a submit box, right?
I want to make just text: "set" that one can click it, then link it to the form action(check.php). I thought I cannot just use <a href> right?

Notice from jlhaslip:
use bbcode " [ code ] [ /code ] " tags when posting any computer code. Inserting it raw in the posting MAY break the forum formatting. Thanks.

Share this post


Link to post
Share on other sites

No you can't use <a></a> tags for submitting forms.And for what you want I think you will have to use javascript.Unfortunatly Javascript isn't my greatest skill so I don't have a clue, try looking on hotscripts or something like that.

Share this post


Link to post
Share on other sites

One reason it would not be a good idea is because the users are familiar with certain default characteristics of Web Pages. Submit buttons on forms and underlining links are several of the standard practices which users are used to seeing. Any deviations might confuse them. For instance, they may think it strange to have a Form with no 'submit' button to use.

Share this post


Link to post
Share on other sites

To add on to jlhaslip's comments, it is impossible to replace the submit box with a normal link. A normal <a href> link will simply point to the next address without passing values properly to the next generation script. Only a submit button is able to handle the form procedures correctly.

Share this post


Link to post
Share on other sites

It could be done but not with text but with images. Firstly you'd need to create 2 images, one which is your normal link text and one the link rollover text:

 

<= Normal

<= Rollover

 

And add the following code into your webpage, altering the URIs respectively:

 

<input type="image" name="submit" value="Alternative Text" src="set_normal.png" onMouseOver="this.src='set_normal_rollover.png';" onMouseOut="this.src='set_normal.png';" onClick="this.form.submit()">

 

[hr=shade].[/hr]

 

In fact come to think about it, you may even just be able to use plain text links:

 

<a href="this.form.submit()" name="submit"> Set </a>

 

But I'm not sure. The former method should work but I haven't tested it yet.

 

Both methods use javascript so you would need to provide a <noscript> alternative using the standard submit button.

Share this post


Link to post
Share on other sites

my friend who ask me to develop his site told me not to use the submit box, because it will ruin his whole design. Thank you for the advice, electriic. I'll try to do that. Also my thanks for the other posters.

Share this post


Link to post
Share on other sites

my friend who ask me to develop his site told me not to use the submit box, because it will ruin his whole design.

Tell your friend that there are various methods of replacing buttons with graphics (that can look like text) if he's that worried about it.

Share this post


Link to post
Share on other sites

It could be done but not with text but with images. Firstly you'd need to create 2 images, one which is your normal link text and one the link rollover tex

Ha.. What a good idea to it using images that looked like a link to replace a link.

Share this post


Link to post
Share on other sites

You don't need the images (save your bandwidth):

This is the script you'll need for that:

<script  language="JavaScript">function goForm(){this.form.submit();}</SCRIPT>

And this is how the link should look like:
<A href="java script:goForm()">Set</A>
(I tried to type 'JavaScript' and not 'java script', but it always changes it back.)
Edited by peroim (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.