Add code for generating a button with javascript in it.
This commit is contained in:
parent
3492f0319c
commit
ac0a00bbc9
2 changed files with 17 additions and 0 deletions
|
@ -436,6 +436,21 @@ ajax_a_jsfuncf(tcp_queue_t *tq, const char *innerhtml, const char *fmt, ...)
|
|||
tcp_qprintf(tq, "\">%s</a>", innerhtml);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void
|
||||
ajax_button(tcp_queue_t *tq, const char *caption, const char *code, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, code);
|
||||
|
||||
tcp_qprintf(tq, "<input type=\"button\" value=\"%s\" onClick=\"",
|
||||
caption);
|
||||
tcp_qvprintf(tq, code, ap);
|
||||
tcp_qprintf(tq, "\">");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -114,4 +114,6 @@ void ajax_generate_select_functions(tcp_queue_t *tq, const char *fprefix,
|
|||
void ajax_a_jsfuncf(tcp_queue_t *tq, const char *innerhtml,
|
||||
const char *fmt, ...);
|
||||
|
||||
void ajax_button(tcp_queue_t *tq, const char *caption, const char *code, ...);
|
||||
|
||||
#endif /* AJAXUI_H_ */
|
||||
|
|
Loading…
Add table
Reference in a new issue