From 6c851b3dc15a7d919f71fb188f4705dab1d06e52 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 2 Jun 2015 00:17:55 +0200 Subject: [PATCH] HtmlInput : add a new function to create an empty anchor --- include/class_html_input.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/class_html_input.php b/include/class_html_input.php index dae4029d7..fc820f63a 100755 --- a/include/class_html_input.php +++ b/include/class_html_input.php @@ -723,6 +723,24 @@ class HtmlInput $r.=h2($name,' class="title" '); return $r; } + /** + * @brief let you create only a link and set an id on it. + * After create a javascript for getting the event + * onclick = function() {...} + * @param type $p_text Text to display + * @param type $p_id id of the link + * @code + * echo HtmlInput::anchor_empty('go','go_id'); + * + * @endcode + */ + static function anchor_empty($p_text,$p_id) + { + $p_url="javascript:void(0)"; + $str=sprintf('%s', + $p_id,$p_text); + return $str; + } /** *Return a simple anchor with a url or a javascript * if $p_js is not null then p_url will be javascript:void(0)