href with form button [closed] - html

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have tried many different ways to go about this however i cant get this to work properly.
Im trying simply to make a "styled" button link to a certain page.
Current code:
<input type="submit" href="aim:goim?screenname=Element18592&message=Hey, Im interested in one of your services." class="btn btn-default" value="Contact">
A link to the page containing this example is: http://www.themodshop.co/shop/test.html
Also when a button is clicked and the cursor is moved away why does it stay black?
When you click on the button titled contact, you will notice it simply does nothing, where im trying to make it link to a certain url the href in the code above. You can go visit the link below and click on "Visit our store" to see a clear example of what im trying to accomplish when the button is clicked
http://www.themodshop.co/shop/
Thank you greatly for any help.

Only <a> elements can have a href attribute. Inputs and buttons are used for forms only.
Try this instead:
Contact

maybe you're trying this, perhaps?:
<form action="aim:goim?screenname=Element18592&message=Hey, Im interested in one of your services." method="POST">
<input type="submit" class="btn btn-default" value="Contact">
</form>
only applies if you have some information to submit, otherwise i suggest you use a like the other answer suggested.

Related

Transition between links using Tab - exclusion some links [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have page with main menu, some links in main content and left menu. The site must be adapted for the blind...
So, when I want to use tab buton to transition between links the order is:
Main menu
Content
Left menu
Is it possible to add some values to <a> tag to 'excluded' it?
You are supposed to add correct tabindex values for doing something like this. So, if you have such a requirement and you don't have the same HTML structure, you can use tabindex to modify the control flow.
Consider this example:
<input value="Last" tabindex="3" />
<input value="First" autofocus tabindex="1" />
<input value="Middle" tabindex="2" />
Now in the above fiddle, see how pressing Tab key affects the control. You can achieve similar if you can use tabindex.

Can I set two values for a submit button? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Note: This is a rewrite of an old post to clarify what was being asked.
Let's suppose I have a single form that displays a set of rows (for example, lines in an order), and I want to place a "delete" button besides each row, but unfortunately I can't create a single form for every row.
In addition let's say that the form goes to a "generic action route" that is the "editCart" controller.
For the sake of the example, let's assume in the form there are several other actions, like for example adding one to the quantity.
This has to be done with multiple submit buttons within the same form.
If it was only one single row, it is easy, just add a name/value to the button and boom! done!.
<form action="/process-edition" method="post">
<div>My nice things</div>
<button type="submit" name="subAction" value="delete">Delete</button>
<button type="submit" name="subAction" value="addOne">+1</button>
</form>
This is saying "hey, controller of the action /process-edition, I'm going to make the subAction delete". Or "the subAction addOne".
But when we have multiple rows, you need to say something like "delete THIS product" or "add one of THIS product".
In this case you need that the button submits like two values: a) the subAction, b) the id of the product to be edited.
<form action="/process-edition" method="post">
<ul>
<li>
Product 1234: 'orange'
<button type="submit" name="subAction" value1???="delete" value2???=1234>Delete</button>
<button type="submit" name="subAction" value1???="addOne" value2???=1234>+1</button>
</li>
<li>
Product 6789: 'lemmon'
<button type="submit" name="subAction" value1???="delete" value2???=6789>Delete</button>
<button type="submit" name="subAction" value1???="addOne" value2???=6789>+1</button>
</li>
</ul>
</form>
I think in this case delete and addOne is what the original post was asking as a "statically assigned value" and the 1234 and 6789 would be the "hidden" values that come from the database. The button "knows" about the Id but does not display the Id itself.
Of course this could be resolved by setting multiple forms to several different controllers with hidden fields in each form. But let's assume you are constricted to a layout that already has the form and you cannot create several forms in it, thus forbidding you to isolate hidden fields to be sent or not sent.
ORIGINAL TEXT OF THE POST:
one value has to be hidden from the user and another has to be displayed.The hidden value is retrieved from the database and the displayed one is statically assigned value?
You can use data- attr
<button type="submit" name="buttonname" data-value="value2" value="Value1">value</button>
then use Element.getAttribute() live DEMO
var buttom = document.querySelector("button");
var dataValue = buttom.getAttribute("data-value");
alert(dataValue);
this way you can set as much value as you want just by add data-*
the best part is you can use
<input type="submit" name="buttonname" data-value3="value3" data-value="value2" value="Value1" />
Demo if you don't like button
Yes, by using a different tool.
<button type="submit" name="buttonname" value="hiddenvalue">Shown Value</button>

What function does a submit button call? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to create my custom submit button. So I need to know what javascript function does the input type submit button call? I don't want a css customized submit button if possible.
In Case your HTML Looks like this:
<form id="myform" name="myform" action="destination.html">
<input id="sub_Button" type="button" value="clickme" onclick="mySubmitFunction();" />
</form>
Do you mean JavaScript?
document.myform.submit();
Or JQuery?
$("#myform").submit();

Create Link "Subscribe" [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have magento commerce, and I am creating in html an automatic e-mail that is going to be sent when someone signs up (in Dreamweaver).
In the HTML code I have a button that is about subscribing in our newsletter. What is the code that I have to link to this image, so if someone clicks on it he will subscribe to the newsletter.
Thanks in advance,
Frank
The call goes to:
http://yourdomain.de/index.php/newsletter/subscriber/new/
But form data is sent via post as you can see in the Mage_Newsletter_SubscriberController newAction, where you find the following line of code.
$this->getRequest()->isPost() && $this->getRequest()->getPost('email')
So you need to name your form field 'email'
Good luck!
Edit:
Just use something like this:
<form action="http://yourdomain.com/index.php/newsletter/subscriber/new/" method="POST" id="newsletter-validate-detail">
<input type="text" class="input-text required-entry validate-email" name="email" id="newsletter">
<input type="image" src="path to image" name="submit" />
</form>

How to implement the dislike-like button [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am developing a web page with rating mechanism, so I need two buttons called "dislike" and "like", once clicked, the rating information would be sent to the server to update the related rating information. What html code should I use, could you give a little code for doing this?
erm... you can't really do that with html alone, mate. You need a server-side script to handle that. Suggest Php.
After that, use a GET or POST method to carry your like or dislike vote to the server-side script.
I am leaving this answer in case if someone else faces this problem in future :
As said by Kaleb , this functionality can not be achieved by html itself, database is must for this because once you close the html page your upvote and downvote counter will be gone.
What you need to do is :
In your database , make a table say "votes" .
This table should have following columns
voteup - this should be filled with two options either yes or no
votedown - this should also be filled with two values "yes" or "no"
voteup_count -This will count the total of upvotes
vote_down - This will count the total of downvotes
Working
Before rendering your html page , check the corresponding entries into database whether the particular post is already upvoted or downvoted
If the post is upvoted and you again click the upvoted button the button text should change from upvoted to upvote and the counter should be decremented by 1 in the database as well under the voteup_count column
If the post is neither upvoted nor downvoted whenever the button is clicked it should increment the respective counter and then again change the button text either to upvoted or downvoted
of course your like and dislike button should also be dynamically created for each form.
<form name="ratings">
<input type="button" name="btnLike" value="Like">
<input type="button" name="btnDislike" value="Dislike">
</form>
Then whatever code you use to check the answer should accept the value of the button as a parameter for the update.
You should use a form. Here is an example I've copied from the Internet.
<form action="mulsub.asp" method="post">
First name: <input type="text" name="fname"><br/>
<input type="submit" name="bsubmit" value="Submit 1">
<input type="submit" name="bsubmit" value="Submit 2">
<input type="submit" name="bsubmit" value="Submit 3">
</form>
Check it out on this webpage. Programmed in ASP, I hate that language by the way :)