I love this article    But the comment list is already closed so I need your help guys!  How to make this code to a form using submit method?  &lt;a class="button" href="#"&gt;  &lt;img src="*.png" alt="" /&gt;Add to cart&lt;/a&gt;   This is the sample of my form where I want the css button to be inserted:  &lt;form action="http://ww6.aitsafe.com/cf/addmulti.cfm" name="mal" method="post"&gt; &lt;input type="hidden" name="userid" value=""&gt; &lt;input type="hidden" name="return" value=""&gt;     &lt;input type="hidden" name="nocart"&gt; &lt;input type="hidden" name="qty1" value="1"&gt; &lt;input type="hidden" name="product1" value=""&gt; &lt;input type="hidden" name="price1" value="150.00"&gt;  &lt;input type=submit value="Add to Cart" onclick="alert('Added to cart\n\nThis page will refresh');"&gt;   update... yehey! :)  Thank You to PCALCAO for the link   There I found the answer of CHRIS to be very helfpful &amp; now it's working...  Correct answer:  &lt;a class="button" href="#" onclick="document.mal.submit(); return false;"&gt;  &lt;img src="*.png" alt="" /&gt;Add to cart&lt;/a&gt;   :)
123115
What's the best way to get a regular anchor (&lt;a href="..."&gt;) to submit the form it is embedded in when clicked?  &lt;form&gt;     &lt;ul&gt;         &lt;li&gt;             &lt;p&gt;                 The link could be &lt;span&gt;embedded &lt;a href="" onclick="?"&gt;at any level&lt;/a&gt;&lt;/span&gt;                 in the form, so "this.parentNode.parentNode..." is no good. :(             &lt;/p&gt;         &lt;/li&gt;     &lt;/ul&gt; &lt;/form&gt;   I know that the easiest way using jQuery would be  $('#myLink').click(function() {     $(this).parents('form:first').submit(); });   ...but I'm trying to find a way to do this without using a library.    Edit: I'm really trying to find a method which doesn't require knowledge of the form (eg: its name, id, etc). This would be similar to how you could put this on an input element: &lt;input onclick="this.form.submit()" /&gt;
2497
I was reviewing in the close votes  when I clicked the "more" link for the specific close reason. I saw the following:    As you can see, the markup is not rendering. There's also a call to .AsHtml() in there which is obviously not markup.  Browser is chrome 31.0.1650.63
62170
How does the code  work with Ctrl + K? I am new to Stack Overflow.   I can't get it with Ctrl + K. I  press space button for 4 times in each line I post.
671
So the SMEs at my current place of employment want to try and disable the back button for certain pages.  We have a page where the user makes some selections and submits them to be processed.  In some instances they have to enter a comment on another page.    What the users have figured out is that they don't have to enter a comment if they submit the information and go to the page with the comment and then hit the back button to return to the previous page.    I know there are several different solutions to this (and many of them are far more elegant then disabling the back button), but this is what I'm left with.  Is it possible to prevent someone from going back to the previous page through altering the behavior of the back button.  (like a submit -> return false sorta thing).    Due to double posting information I can't have it return to the previous page and then move to the current one.  I can only have it not direct away from the current page.  I Googled it, but I only saw posts saying that it will always return to the previous page.  I was hoping that someone has some mad kung foo js skills that can make this possible.  I understand that everyone says this is a bad idea, and I agree, but sometimes you just have to do what you're told.
46585
I have a output view page, and i want to insert a edit command button. when user click on edit button it will enable them to type on output field and save. Can anybody tell me how to do that? Thanks  &lt;apex:page standardController="Product_Brief__c" sidebar="true" showHeader="true" extensions="gibco" &gt;&lt;br/&gt; &lt;apex:form &gt;&lt;br/&gt;             &lt;apex:pageBlock mode="inlineEdit"&gt;&lt;br/&gt;             &lt;apex:pageBlockSection collapsible="false" title="Section 1: Custom Media Information (Required)"&gt;&lt;br/&gt;                 &lt;apex:outputField value="{!Product_Brief__c.Opportunity__r.Account.Name}"  Label="Company Name"/&gt;&lt;br/&gt;                 &lt;apex:outputField value="{!Product_Brief__c.Customer_Number__c}" label="Customer Number"/&gt;&lt;br/&gt;                 &lt;apex:outputField value="{!Product_Brief__c.Billing_Address__c}" /&gt;&lt;br/&gt;                 &lt;apex:outputField value="{!Product_Brief__c.CreatedBy.Name}"  Label="Contact Name"/&gt;&lt;br/&gt;                 &lt;apex:outputField value="{!Product_Brief__c.Shipping_Address__c}"/&gt;             &lt;/apex:pageBlockSection&gt;&lt;br/&gt;  &lt;apex:pageblockButtons &gt;&lt;br/&gt;                 &lt;apex:commandButton action="{!save&amp;view}" value="SAVE"/&gt;&lt;br/&gt;                 &lt;apex:commandButton value="PRINT" onclick="window.print();"/&gt;&lt;br/&gt;                 &lt;apex:commandButton value="Cancel" action="{!Cancel}"/&gt;&lt;br/&gt;             &lt;/apex:pageblockButtons&gt;&lt;br/&gt; &lt;/apex:form&gt;
22512
I can't edit a question that has a jsfiddle link because it has a lack of code. Can we get privileged users able to bypass restriction? The question had some really poor formatting and linking and I couldn't fix it. :  Html is not taking the css code Some of my html tags are not reacting by the css which i gaved them for example is offerbox not reaction to the html part. all html parts down from offerbox are not taking the styles that i gaved the enter code here http://jsfiddle.net/8Bw7M/  pic from the html and css  I feel that as a privileged user, I should be able to make the changes needed. This is related, but I'm not adding any new links.
22242
I'm in a bit of a verbiage bind. I have a form for a request cancellation. I cannot change the wording on that. The word cancel HAS to be used.  The button bellow sits in the footer of a card. Unfortunately, I cannot show you the rest of the card for context.      Clicking that button brings up the above form in the footer of the card.  The pattern shown here (form input on one line, followed by a cancel and submit button with the below styles and ordering) is used across the application. This is another non negotiable. Clicking that cancel button collapses the form back into the original button ("Cancel Request").  As you can probably tell as this point, I have a Cancel-Cancel-Conundrum. I need a better word than cancel for that form button, but I'm having trouble thinking of something. I was thinking something along the lines of "Exit" but that feels a little weird.
60693
I'm using stackoverflow.com with JavaScript off. I accept this comes with somewhat less functionality, however for the most part SO works fine.  If I look at the home page (), every single button on there except for two types works with JS off.  The first second is that the "x Votes; y answers;z views" mouse-over indicates they're links but clicking them does nothing. This one is less of an issue because the user can still click the question title, and they're only implied buttons anyway.  The second (and bigger) issue is the "Add" buttons next to "Favorite Tags" and "Ignored Tags". These are explicit buttons that don't do anything with JS off. There is no working JS substitute for them (the "tag subscriptions" link itself works, but the page it goes to doesn't work with JS off, but that's another bug report).
47940
How do you think about disabling the submit-button until the user has completed the form or the required fields?   I find similar questions here on ux.se and somebody answered that the user will think that the form is broken or not immediately realize whats going on.  I think hiding is not that good but a disabling (e.g. grayscale, opacity, ...) plus a short text in the button would improve usability because the user realise that he still has to fill out something.  Is there anybody with experience or examples besides the usual error-messages/validation after submitting?
9182
Just recently,  question was posted. Here's the body of the question:     Write a function called highlight() that prompts the user for a string. Your code should ensure that the string is all lower case. Next, prompt the user for a smaller 'substring' of one or more characters. Then replace every occurrence of the substring in the first string with an upper case. Finally, report to the user how many changes were made (i.e., how many occurrences of the substring there were).      What would a script for this be?   This is basically a "do my homework for me" style question. In the past, I would have voted to close this question for lacking minimal understanding and moved on. However, it looks like this close reason was removed, and I'm having difficulty figuring out which alternative to use (if at all).  Here were some of the close reasons I was considering, and ultimately decided against since they didn't seem to precisely match:   Duplicate of    I sort of doubt there exists a precise duplicate of this question -- the question is a fairly specific request for some code. I could maybe link to a duplicate question that answers a part of the original (for example, checking if the string is lowercase), but it wouldn't answer every aspect of the problem. Problem that can't be reproduced/typographical error    This sort of matches, since it asks the user to produce a SSCCEE, but doesn't really match since there isn't even a problem to begin with (and closing a question because I couldn't "reproduce" a non-existent problem feels a bit silly to me) Unclear what you're asking    It's pretty obvious what the user is asking -- I could produce a 5 line script in about 20 seconds that precisely matches his spec. Too broad    The text for "Too broad" states that "There are either too many possible answers, or good answers would be too long for this format". This doesn't apply to this question -- once again, the answer I could give would be fairly short and would closely resemble solutions other people would give.   So, what should I do here? Am I misunderstanding how the close reasons should now be used? Should I use the "other" close reason and explain that the OP should have put in more effort? Should I simply downvote, perhaps leave a comment, and move on? Or is the new policy to embrace these kinds of questions and just post an answer?
43168
Let's say you create a wizard in an HTML form. One button goes back, and one goes forward. Since the back button appears first in the markup when you press Enter, it will use that button to submit the form.  Example:    &lt;form&gt;   &lt;!-- Put your cursor in this field and press Enter --&gt;   &lt;input type="text" name="field1" /&gt;    &lt;!-- This is the button that will submit --&gt;   &lt;input type="submit" name="prev" value="Previous Page" /&gt;    &lt;!-- But this is the button that I WANT to submit --&gt;   &lt;input type="submit" name="next" value="Next Page" /&gt; &lt;/form&gt;     I would like to get to decide which button is used to submit the form when a user presses Enter. That way, when you press Enter the wizard will move to the next page, not the previous. Do you have to use tabindex to do this?
26203
I'm trying to direct a browser to a different page. If I wanted a GET request, I might say  document.location.href = 'http://example.com/q=a';   But the resource I'm trying to access won't respond properly unless I use a POST request. If this were not dynamically generated, I might use the HTML  &lt;form action="http://example.com/" method="POST"&gt;   &lt;input type="hidden" name="q" value="a"&gt; &lt;/form&gt;   Then I would just submit the form from the DOM.  But really I would like JavaScript code that allows me to say  post_to_url('http://example.com/', {'q':'a'});   What's the best cross browser implementation?  Edit   I'm sorry I was not clear. I need a solution that changes the location of the browser, just like submitting a form. If this is possible with , it is not obvious. And this should not be asynchronous, nor use XML, so Ajax is not the answer.
46191
I'm still getting flack about . I downvoted an answer and added a comment explaining my reason. I was later convinced by other comments that it was not a good reason for downvoting. Upon attempting to retract my vote, I inadvertently locked it in.  The hover-text still (over a year later) says I can "click again to undo". But it's a big fat lie.  My specific problem has been resolved. But, I have stumbled across other questions where users have done this. In keeping with the push to help new users not to discover rules after having broken them, I think this text needs to be a little more aware, a little more accurate.
90313
If I edit a question and then click the "close" link, it doesn't work. Nothing appears on the screen and I'm forced to reload the page before the link works.  A  covers similar ground (except my edit wasn't inline), however this was apparently fixed.  (I've tagged as  as this is the only site I have the reputation to reproduce the issue on.)
32885
I have some html like this:  &lt;div id="1"&gt;     &lt;p&gt;         Volume = &lt;input type="text" /&gt;         &lt;button rel="3.93e-6" class="1" type="button"&gt;Check answer&lt;/button&gt;     &lt;/p&gt;     &lt;div&gt;&lt;/div&gt; &lt;/div&gt;   and some JS like this:  $("button").click(function () {     var buttonNo = $(this).attr('class');     var correct = Number($(this).attr('rel'));      validate (Number($("#"+buttonNo+" input").val()),correct);     $("#"+buttonNo+" div").html(feedback); });   What I'd really like is if I didn't have to have the class="1" on the button (I know numeric classes aren't valid, but this is a WIP!), so I could determine buttonNo based on the id of the parent div. In real life there are multiple sections looking like this.   How do I find the id of the div parenting the button. What would be a more semantic way to store the answer in the button code. I want to make this as foolproof as possible for a non programmer to copy and paste without breaking things!
44468
On beta sites, when a post gets closed without comment, Community ♦ flags it for moderator attention.   Apparently, a comment entered through the freeform close reason doesn't count:    As you can clearly see, there should be no doubt that a comment already exists on the post  Could this be fixed? I don't think it's that important -- I just have to decline the flag, however on larger sites this may lead to a lot of extra flags.
110229
What is the easiest way to change the Add to cart form button text to something custom? I want to change the text only on certain product types. How should I approach this?