Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css input submit link

Tags:

css

I have this html:

      <form id="REVIEW" method="post" action="/SortReviews">
        <fieldset class="sort">
          <input type="submit" value="$ratingLine"/>            
        </fieldset>
      </form>

I want to give the submit button some css, so it looks like a link.

{
    background: none;
    border: none;
    color: blue;
    text-decoration: underline;
    cursor: pointer;
}

How do I do it?

like image 521
SuperString Avatar asked Apr 20 '11 17:04

SuperString


People also ask

How Add URL in submit button?

Link Submit Button Using Anchor Tags In HTML Write/Declare a Submit button between the Anchor tag's Starting and Closing tags. Give a Path where you wish to link your Submit Button by using the href property of the Anchor element.

How do you put a href in input submit?

In HTML Anchor tag's href attribute, we have to give our Another Web page's link (Where we want to Link out Input type submit Button). To Link HTML Input type submit to another page using HTML Form tags, we have to declare/write our HTML input type submit button between HTML Form Tag's Starting and Closing Tags.

How do I submit a form by link?

When we click on the link, the function submitForm() will get executed. This function will get the element object using DOM getElementById() method by passing the form id to this method, then the form will be submitted by using submit() method.

How do you use input submit?

The HTML <input type=”submit”> is used to define a submit button. It is used to submit all the user value to the form handler. The Form Handler is a server page that activates a script for processing all the input values.


2 Answers

<style type="text/css">
form input[type="submit"]{

    background: none;
    border: none;
    color: blue;
    text-decoration: underline;
    cursor: pointer;
}
</style>

Is this not what you're looking for?

The other option, as already noted, is to use javascript to submit the form onclick of a anchor element:

<a href="#" onclick="document.review.submit()">submit</a>       

with your form having an attribute: name="review"

like image 87
Herman Schaaf Avatar answered Oct 14 '22 18:10

Herman Schaaf


You should assign a class to the button

<input type="submit" value="$ratingLine" class="link-lookalike"/>

and in your css file (or inside a <style type="text/css"></style> tag) use

.link-lookalike {
    background: none;
    border: none;
    color: blue;
    text-decoration: underline;
    cursor: pointer;
}

this way you can assign the class to different buttons in your page (if required), and they will all get the same look.

like image 21
Gabriele Petrioli Avatar answered Oct 14 '22 16:10

Gabriele Petrioli