What’s the difference between “Request Payload” vs “Form Data” as seen in Chrome dev tools Network tab

The Request Payload – or to be more precise: payload body of a HTTP Request is the data normally send by a POST or PUT Request. It’s the part after the headers and the CRLF of a HTTP Request. A request with Content-Type: application/json may look like this: POST /some-path HTTP/1.1 Content-Type: application/json { “foo” … Read more

Angular2 – Radio Button Binding

use [value]=”1″ instead of value=”1″ <input name=”options” ng-control=”options” type=”radio” [value]=”1″ [(ngModel)]=”model.options” ><br/> <input name=”options” ng-control=”options” type=”radio” [value]=”2″ [(ngModel)]=”model.options” ><br/> Edit: As suggested by thllbrg “For angular 2.1+ use [(ngModel)] instead of [(ng-model)] “

Multiple forms in a single page using flask and WTForms

The solution above have a validation bug, when one form cause a validation error, both forms display an error message. I change the order of if to solve this problem. First, define your multiple SubmitField with different names, like this: class Form1(Form): name = StringField(‘name’) submit1 = SubmitField(‘submit’) class Form2(Form): name = StringField(‘name’) submit2 = … Read more

VBA: Using WithEvents on UserForms

You can create an event-sink class that will contain the event-handling code for all of your controls of a particular type. For example, create the a class called TextBoxEventHandler as follows: Private WithEvents m_oTextBox as TextBox Public Property Set TextBox(ByVal oTextBox as TextBox) Set m_oTextBox = oTextBox End Property Private Sub m_oTextBox_Change() ‘ Do something … Read more

Adding causes java.lang.IllegalStateException: Cannot create a session after the response has been committed

This is a known problem and has been reported by yours truly as issue 2215. This will occur when the response buffer has overflowed (due to large content) and the response is been committed before the session is been created. This is result of bit overzealous attempts of Mojarra to postpone “unnecessary” session creation as … Read more

Using the HTML5 “required” attribute for a group of checkboxes?

Unfortunately HTML5 does not provide an out-of-the-box way to do that. However, using jQuery, you can easily control if a checkbox group has at least one checked element. Consider the following DOM snippet: <div class=”checkbox-group required”> <input type=”checkbox” name=”checkbox_name[]”> <input type=”checkbox” name=”checkbox_name[]”> <input type=”checkbox” name=”checkbox_name[]”> <input type=”checkbox” name=”checkbox_name[]”> </div> You can use this expression: $(‘div.checkbox-group.required … Read more