function fp_get_js_prompt_link

6.x misc.inc fp_get_js_prompt_link($question, $default, $action_if_yes, $link_text, $extra_class = "")
4.x misc.inc fp_get_js_prompt_link($question, $default, $action_if_yes, $link_text)
5.x misc.inc fp_get_js_prompt_link($question, $default, $action_if_yes, $link_text)

Creates a javascript "prompt" link, which will ask the user a question.

Similar to the fp_get_js_confirm_link function, but this is a prompt box which lets the user type in a response.

See also

fp_get_js_confirm_link

1 call to fp_get_js_prompt_link()
user_user_roles_form in modules/user/user.module
This form allows the user to manage the roles in the system.

File

includes/misc.inc, line 1394
This file contains misc functions for FlightPath

Code

function fp_get_js_prompt_link($question, $default, $action_if_yes, $link_text) {

  $rtn = "";

  $question = fp_reduce_whitespace($question);

  $question = htmlentities($question, ENT_QUOTES);
  $question = str_replace("\n", "\\n", $question);

  $rtn .= "<a href='javascript: var response = prompt(\"$question\", \"$default\");
                                if (response != null) 
                                {
                                   $action_if_yes ;  
                                }
                                '>$link_text</a>";


  return $rtn;
}