Add code for generating a button with javascript in it.

This commit is contained in:
Andreas Öman 2008-05-03 08:06:28 +00:00
parent 3492f0319c
commit ac0a00bbc9
2 changed files with 17 additions and 0 deletions

View file

@ -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, "\">");
}
/*

View file

@ -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_ */