src/chxj_hdml.c
/**
 * The substitution processing of tag "input type = checkbox" is done. 
 * 
 * @param hdml [i/o] The pointer to the HDML structure at the output 
 *                   destination is specified. 
 * @param tag  [i]   The tag node of input type=checkbox is specified. 
 */
The substitution processing of tag "input type = checkbox" is done.

@param hdml [i/o] The pointer to the HDML structure at the output
destination is specified.
@param tag  [i]   The tag node of input type=checkbox is specified.
The substitution processing of tag " input type = checkbox " is done . @param hdml [ i / o ] The pointer to the HDML structure at the output destination is specified . @param tag [ i ] The tag node of input type = checkbox is specified .
static void
s_hdml_do_input_checkbox_tag(hdml_t *hdml, Node *tag)
{
  Doc         *doc       = hdml->doc;
  request_rec *r         = doc->r;
  char        *nm        = NULL;
  char        *val       = NULL;
  int         chk;
  if (! hdml->has_checkbox) {
    hdml->has_checkbox++;
    s_output_to_hdml_card(hdml, 
                    "<NODISPLAY NAME=\"_chk\">\r\n"
                    "<ACTION TYPE=\"ACCEPT\" TASK=\"RETURN\" "
                                             "RETVALS=\"_uchk;$V;X\" >\r\n"
                    "</NODISPLAY>\r\n"
                    "<NODISPLAY NAME=\"_uchk\">\r\n"
                    "<ACTION TYPE=\"ACCEPT\" TASK=\"RETURN\" "
                                             "RETVALS=\"_chk;;_\" >\r\n"
                    "</NODISPLAY>\r\n"
                    );
    DBG(r, "wrote checkbox hdml card.");
  }
  chk = qs_is_checked_checkbox_attr(doc, tag, r->pool);
  val = qs_get_value_attr(doc, tag, r->pool);
  nm  = qs_get_name_attr(doc, tag, r->pool);
  if (! val) {
    val    = qs_alloc_zero_byte_string(r->pool);
  }
  if (! nm) {
    nm   = qs_alloc_zero_byte_string(r->pool);
  }
  s_output_to_hdml_out(hdml, apr_psprintf(r->pool, 
                                "<A TASK=GOSUB LABEL=\"check\" "
                                   "DEST=\"#$%s%02d\" "
                                   "VARS=\"V=%s\" "
                                   "RECEIVE=\"%s%02d;%s%02d;%s%02d\">"
                                   "$%s%02d</A>\r\n",
                                s_get_form_no(r, hdml),
                                hdml->var_cnt[hdml->pure_form_cnt] + 0,
                                val,
                                s_get_form_no(r, hdml),
                                hdml->var_cnt[hdml->pure_form_cnt] + 0,
                                s_get_form_no(r, hdml),
                                hdml->var_cnt[hdml->pure_form_cnt] + 1,
                                s_get_form_no(r, hdml),
                                hdml->var_cnt[hdml->pure_form_cnt] + 2,
                                s_get_form_no(r, hdml),
                                hdml->var_cnt[hdml->pure_form_cnt] + 2));
  if (chk) {
    s_output_to_init_vars(hdml, 
                    apr_psprintf(r->pool, 
                            "%s%02d=_uchk&%s%02d=%s&%s%02d=X",
                            s_get_form_no(r, hdml),
                            hdml->var_cnt[hdml->pure_form_cnt] + 0,
                            s_get_form_no(r, hdml),
                            hdml->var_cnt[hdml->pure_form_cnt] + 1,
                            chxj_escape_uri(r->pool,val),
                            s_get_form_no(r, hdml),
                            hdml->var_cnt[hdml->pure_form_cnt] + 2
                            ));
  }
  else {
    s_output_to_init_vars(hdml, 
                    apr_psprintf(r->pool, 
                            "%s%02d=_chk&%s%02d=&%s%02d=_",
                            s_get_form_no(r, hdml),
                            hdml->var_cnt[hdml->pure_form_cnt] + 0,
                            s_get_form_no(r, hdml),
                            hdml->var_cnt[hdml->pure_form_cnt] + 1,
                            s_get_form_no(r, hdml),
                            hdml->var_cnt[hdml->pure_form_cnt] + 2
                            ));
  }
  s_output_to_postdata(hdml, 
                  apr_psprintf(r->pool, "%s%s=$%s%02d",
                                  CHECK_BOX_PREFIX,
                                  nm,
                                  s_get_form_no(r, hdml),
                                  hdml->var_cnt[hdml->pure_form_cnt] + 1));
  hdml->var_cnt[hdml->pure_form_cnt] += 3;
}
static void s_hdml_do_input_checkbox_tag ( hdml_t * hdml , Node * tag ) { Doc * doc = hdml -> doc ; request_rec * r = doc -> r ; char * nm = NULL ; char * val = NULL ; int chk ; if ( ! hdml -> has_checkbox ) { hdml -> has_checkbox ++ ; s_output_to_hdml_card ( hdml , " \" \" \r \n " " \" \" \" \" " " \" \" \r \n " " \r \n " " \" \" \r \n " " \" \" \" \" " " \" \" \r \n " " \r \n " ) ; DBG ( r , " " ) ; } chk = qs_is_checked_checkbox_attr ( doc , tag , r -> pool ) ; val = qs_get_value_attr ( doc , tag , r -> pool ) ; nm = qs_get_name_attr ( doc , tag , r -> pool ) ; if ( ! val ) { val = qs_alloc_zero_byte_string ( r -> pool ) ; } if ( ! nm ) { nm = qs_alloc_zero_byte_string ( r -> pool ) ; } s_output_to_hdml_out ( hdml , apr_psprintf ( r -> pool , " \" \" " " \" \" " " \" \" " " \" \" " " \r \n " , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 0 , val , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 0 , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 1 , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 2 , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 2 ) ) ; if ( chk ) { s_output_to_init_vars ( hdml , apr_psprintf ( r -> pool , " " , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 0 , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 1 , chxj_escape_uri ( r -> pool , val ) , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 2 ) ) ; } else { s_output_to_init_vars ( hdml , apr_psprintf ( r -> pool , " " , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 0 , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 1 , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 2 ) ) ; } s_output_to_postdata ( hdml , apr_psprintf ( r -> pool , " " , CHECK_BOX_PREFIX , nm , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 1 ) ) ; hdml -> var_cnt [ hdml -> pure_form_cnt ] += 3 ; }
The substitution processing of tag "input type = checkbox" is done.
The substitution processing of tag " input type = checkbox " is done .
/*--------------------------------------------------------------------------*/ /* It is posted to the one without the checked attribute.                   */ /* However, they were able to be removed with INPUT FILTER.                 */ /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* It is examined whether it is CHECKED.                                    */ /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* The value of the name attribute and the value attribute is acquired      */ /* respectively.                                                            */ /*--------------------------------------------------------------------------*/