text:
Q: How to hide html5 form validation on reseting form I have an HTML page with input fields and two buttons: Submit and Reset. When the user clicks on Submit, the required validation messages come up, that's fine, but they also come up when clicking Reset.
HTML:

    <form action="insertVoucherCategory" method="post">

                Voucher Category

                <input  name="voucherCategory" id="voucherCategory" title="Please Enter Voucher Category" required="required" placeholder="Enter Voucher Category" tabindex="1" />

                Description

                <input  name="description" id="description" title="Please Enter Description" required="required" placeholder="Enter Description" tabindex="2" />

                <input type="submit" id="btnAdd" value="Submit" tabindex="3"/>

                <input type="reset" id="btnReset" value="Reset" tabindex="4"/>

    </form>

This is what happens on Reset:

This is what I want:

A: <input type="button" value="Reset" onclick="hideMsg()" />

function hideMsg(){
  $('.errMsg').hide();
  $('.required').val('');
  $('.required').addClass('blueBorder');
  $('.required').removeClass('redBorder');
}

A: Use the type="reset" attribute on an <input> or <button> to automatically use HTML5 validation to clear the validation highlighting.
Tested satisfactorily on IE11 and Edge on Windows 10...


text:
Q: Can we call http.Error() before a webSocket connection upgrade? I'm using Gorilla WebSockets.
I pass some parameters in the url to the HandlerFunc and I need to check that they are valid.
If they are, I upgrade the connection to a webSocket and use it.
If they aren't, I would like to call http.Error to report the error to the user.
Is this the right way of doing this ?
Here is an example code:
var upgrader = websocket.Upgrader{} // use default options

func myHandler(w http.ResponseWriter, r *http.Request) {
    keys, ok := r.URL.Query()["key"]
    if !ok {
        http.Error(w, "missing key parameter", http.StatusNotFound)
        return
    }
    ws, err := upgrader.Upgrade(w, r, nil)
    if err != nil {
        log.Print("upgrade:", err)
        return
    }
    defer ws.Close()
    ...
}

redpajama_set_name: RedPajamaStackExchange


Looking for cheaper and best quality flip covers for LeTV 1S? Do check this Ask Expert thread for more information.
I would like to know the best flip covers for Letv Le 1S smartphone. Please let me know the best available options which are durable, reasonably priced and have premium looks.
You can buy this cover from Maxbhi.com. The cover is available in Black color. It is priced at Rs. 272.
The cover is available in white color option. You can buy it from Portamart. The price of the flipcover is Rs. 175.
Please note that the device is still new. It may take some time for the newer varieties of the cover to be available. We will need to wait till then.


Heat the olive oil & saute the onion, leeks, fennel & garlic until they soften - about 5 minutes. Just as they begin to brown a touch - add the vegetable stock, serranos, lemon zest & corn. Bring to a boil. Reduce heat to low and add the coconut milk & crushed red pepper. Simmer about 15 minutes. Add some chopped cilantro and &P to taste.
In batches in a blender, puree the soup. I left about 1-2 cups of it as is (chunky) - to add some texture to the chowder.
Serve with cilantro, raw corn & the dilly parts of the fennel & plenty of cracked pepper. Drizzle with sriracha - if using.


Her daughter has suffered from Anorexia Nervosa for almost four years. Now desperate mum Sarah Weddle has turned to crowdfunding for life saving treatment.
Weddle, 40, believes the only hope for her daughter, Chloe, is with 'psychological treatment'.
Over the last two years, Chloe has been in and out of three different NHS Eating disorder units, Weddle explained.
'Chloe WANTS to get well, she wants to go to university and study Marine Biology, she wants her life back and to live a happy fulfilled one! But without the psychological help, I can't ever see this being a reality,' she said.
Her family hopes to send her to a specialist hospital in Marbella, Spain. However, six months there will cost up to £45,000, the Daily Mail reports.
'She would have in depth therapy on a daily basis, which I think would really help,' said Weddle told The Daily Mail. 'At this place they believe a mixture of having a dietician to get the weight restored, getting medical help and undergoing therapy can get you better.