Forum Moderators: not2easy

Message Too Old, No Replies

No submit button but link only

is it possible

         

henry0

1:12 pm on Mar 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is it possible to set a link that will "submit" when clicked instead of the usual submit button
my problem is space I do not have more that about 3 pix height to make the button,
so no button could be my best option.

or could I stlye a radio button in order to set its height?

Any other suggestion?

thanks

Little_G

1:41 pm on Mar 4, 2007 (gmt 0)

10+ Year Member



Hi,

You can use javascript to submit a form from a link, or you can style a submit button to make it look like a link:

<input type="submit" id="submitB" value="go">

#submitB{
border:none;
padding:0;
margin:0;
font-size:xx-small;
text-decoration:underline;
color:blue;
background-color:transparent;
}

ps:radio buttons are notoriously difficult to style.

Andrew

henry0

2:19 pm on Mar 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Looks to do exactly what I need!
thanks

Little_G

2:23 pm on Mar 4, 2007 (gmt 0)

10+ Year Member



No problem.

henry0

3:53 pm on Mar 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is fine and will do well

But is it possible to get also some sort of "hover" or "alt" short message; reason is: Since it's a form of course I have no "pointer" or other means that indicates some possible action

Little_G

4:08 pm on Mar 4, 2007 (gmt 0)

10+ Year Member



Hi,

You can try the 'title' attribute it works in Firefox.

Andrew

SuzyUK

4:10 pm on Mar 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you can have both the cursor indicator and the tooltip

for the cursor add

cursor: pointer;
to the CSS for the button

and

for the tooltip add

title="Your Tooltip Text"
to the HTML for the button

[added] - Andrew's too quick ;) .. title also works in IE/Opera

[edited by: SuzyUK at 4:13 pm (utc) on Mar. 4, 2007]

henry0

4:14 pm on Mar 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, Now it becomes user friendly :)

henry0

4:18 pm on Mar 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Too bad the form/link does not work in FF
it reverses to the classical form button

henry0

4:23 pm on Mar 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here are CSS and HTML
.submitB{
border:none;
padding:0;
margin:0;
font-size:xx-small;
text-decoration:underline;
color:blue;
background-color:transparent;
cursor:pointer;
}

<li><? echo"<input type='hidden' name='state' value='alabama'>";?><input type="submit" name="submit" value="Alabama"<span class="submitB"></span></li>

SuzyUK

4:55 pm on Mar 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That HTML is not valid henry0 and FF is choking on it!

even allowing for the stray PHP tags in your example, which are likely not in the generated output you shouldn't have a span nested inside an input.

your generated output should be something like this..

<input type='hidden' name='state' value='alabama'>
<input type="submit" name="submit" value="Alabama" title="your tooltip text" class="submitB">

henry0

5:16 pm on Mar 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It works!
The php is a leftover of a previous test
and now you understand why we have a "CSS coder on call" :)
But Today is Sunday and I needed to do a few things
thanks for helping me out!