Google Material Icon In a HTML input? - html

I want an icon to go into an input submit button. I've tried the following, but it doesn't work. Any advice?
<input type="submit" name="submit" value="Submit" />
I wanna put the following in:
<i class="material-icons">star_rate</i>

There are various ways this can be done but according to your code just use
<button type="submit" name="submit"><i class="material-icons">star_rate</i></button>

Related

Picture in a value = (HTML)

How could I put an image inside my HTMl part of the code
<input id="sendButton" type="button" value=<img src="sendbutton.jpg"> />
I thought this would work but when I run the website it just shows as text "img src />"
Is there any way I could do this?
What this is about is a send button for a chat application, initially I had
<input id="sendButton" type="button" value="Send" />
Which worked perfectly and showed the button as "Send", but I would love to use an image in there like twitter, instagram etc... does.
What you have is simplly broken/invalid HTML. If you want a button which contains an image, but the image inside of a button:
<button id="sendButton">
<img src="sendbutton.jpg">
</button>
If (less likely, but anything is possible) you want the value of an input to be an HTML string, it needs to be HTML-encoded:
<input id="sendButton" type="button" value="<img src="sendbutton.jpg">" />
You can try this basic syntax and then customize it
<button type="submit" id="sendButton"><img src="sendbutton.jpg"></button>

HTML button to direct to PayPal Gving Fund not working

Can someone tell me why this codes will not link to the page?
<form><input class=”MyButton” type=”button” value=”PayPal Giving Fund” onclick=”window.location.href=’paypal.com/us/fundraiser/charity/1521457//button- links.php'” /></form>
I have also tried
<form><input class="MyButton" type="button" value="PayPal Giving Fund" onclick="window.location.href='htpps://www.paypal.com/us/fundraiser/charity/1521457/button-links.php'" /></form>
Neither work. Says page cannot be found.
try this
you had a typo in 'htpps' also use the action param of the form instead of a onclick, it's mean to do that
<form action='https://www.paypal.com/us/fundraiser/charity/1521457/button-links.php'>
<input class="MyButton" type="submit" value="PayPal Giving Fund">
</form>

How to change submit button name in HAML?

I am new to Haml and have a form with two submit buttons. To differentiate and handle them in the Controller every single button needs a name.
An example from HAML:
= program_form.submit I18n.t('texts.6OA')
appears in HTML as:
<input type="submit" name="commit" value="Save Template">
but I want something like this:
<input type="submit" name="Button2" value="Save Template">
Any hints?
Have you tried this?
program_form.submit I18n.t('texts.60A'), name: 'Button2'

Submit Button not working - could be broken code?

Need help to get my form working. I am creating it for a website as a small school project.
Below is the code to the submit button. Am I missing something? (I can place the whole code if needed):
<form>
<!-- END_ITEMS -->
<input type="hidden" name="EParam" value="FzpUCZwnDno=" />
<div class="outside_container">
<input type="button" onclick="Vromansys.FormBuilder.showPreview()" value="Submit Form" class="submit_button" id="FSsubmit" />
</div>
</form>
Did you try input type="submit" ... instead of "button"? It should work with "submit" when using "form".
Best regards,
Dino

Problem with form buttons in IE

I have buttons on a page that look like:
<p>
<a href="view.php">
<input type="button" name="view" value="View Database" />
</a>
</p>
IE does not support these buttons or multiple buttons I am not sure which one. Does anyone know how to fix this to work with IE?
Embedding a button within an <a> tag is not normally done, and really doesn't make any sense. If you want your link to look like a button, then just use the <input> tag with some script on the onclick event, or use css to make your link look button-ish (start by using display:block or display:inline-block);
You can't put an input into the tag, instead, you can create a form, and change your button to a submit one. Then you can choose the target url in the form, like this:
<form action="view.php">
<input type="submit" name="view" value="View Database" />
</form>
I would recommend this over using javascript, because buttons are not designed for navigating a site. If you want to submit information, which is what they are used for, you won't be able to do it so cleanly using javascript.
What exactly are you trying to achieve? If you want a custom button to redirect to view.php, you can use onclick:
<input type="button" name="view" value="View Database" onclick="window.location.href='view.php';" />
or something similar.
<input type="button"
onclick="javascript:document.location='view.php';"
value="View Database"/>
Try with this ugly monster:
<input type="button" name="view" value="View Database" onclick="javascript:window.location='view.php'"/>