def channel_form(channels):
    """Construct HTML for the channel selection form."""
    channel_checkbox_form_html = \
        "<input type=\"checkbox\" name=\"channel\" value=\"{0}\">{0}"
    channel_form_html = ""
    for channel in channels:
        channel_form_html = \
            channel_form_html + \
            channel_checkbox_form_html.format(channel) + "</br>"

    eps = "Episodes per page (between 1 and 100):" + \
          "<input type=\"number\" name=\"episodes\" " + \
          "min=\"1\" max=\"100\" value=\"20\"></br>"
    pages = "Pages (between 1 and 3):" + \
            "<input type=\"number\" name=\"pages\" " + \
            "min=\"1\" max=\"3\" value=\"1\"></br>"

    form = "<form action=\"/rt-recently-added\" method=\"post\">{0}{1}{2}" + \
           "<input type=\"submit\"></form>"

    form = form.format(channel_form_html, eps, pages)

    return form