Author Topic: tool tip for a Prompt  (Read 933 times)

Offline TheDarkKnight

  • Full Member
  • ***
  • Posts: 27
  • Forum Citizenship: +0/-0
tool tip for a Prompt
« on: 01 Sep 2010 03:03:17 pm »
Hello Pals,
My requirement is to show tooltip when we have a mouse over a value prompt. For eg...i have a value prompt for Status. when a user does a mouse over the prompt, it should show tooltip like 'Choose ordered status......'

i cud able to tooltip for a text using <a title> and </ a> tags in a prompt page.
but doesnot able to tooltip for the prompt itself using these tags.

Appreciate any sort of help!

If above detailsa are not clear, then pls letme know.

Cheers
TDK

« Last Edit: 02 Sep 2010 01:31:00 pm by TheDarkKnight »

Offline technomorph

  • Senior Member
  • ****
  • Posts: 70
  • Forum Citizenship: +2/-0
Re: tool tip for a Prompt
« Reply #1 on: 02 Sep 2010 05:32:25 pm »
Hi,

Assuming you're using a standard drop down value prompt. This should work:

Create a <DIV> tag around the value prompt using two HTML Items:

<div id="VP_myPrompt">

</div>



Then add another HTML Item and include the following:


<script type="text/javascript">

   var oContainer = document.getElementById("VP_myPrompt");
   var oPrompt= oContainer.getElementsByTagName("select");
   oPrompt[0].title = "My value prompt tool tip message.";

</script>


Cheers
« Last Edit: 02 Sep 2010 06:30:08 pm by coggod »

Offline TheDarkKnight

  • Full Member
  • ***
  • Posts: 27
  • Forum Citizenship: +0/-0
Re: tool tip for a Prompt
« Reply #2 on: 06 Sep 2010 12:53:37 pm »
Thx technomorph!!..This helps.

i use list box for the value prompt. Got the code for it and it works now

Create a <DIV> tag around the value prompt using two HTML Items:

<div id="ORD">

</div>

Put another HTML Item
<script>
{

   var get_myList = document.getElementById("ORD");
   if (get_myList != null)
   {
      var target_list = get_myList.getElementsByTagName("SELECT")[0];
      if (target_list != null)
      {
         var arr_items = target_list.getElementsByTagName("OPTION");
         for ( var i = 0; i < arr_items.length; i ++ )
         {
            arr_items.title = "Choose status based on Order's status";
         }
      
      }
   }
}
</script>


Thx Again!!

Offline technomorph

  • Senior Member
  • ****
  • Posts: 70
  • Forum Citizenship: +2/-0
Re: tool tip for a Prompt
« Reply #3 on: 06 Sep 2010 07:51:26 pm »
Happy to help. This is useful.

Just an observation (and admittedly being a bit pedantic :)), but I reckon the code could be simplified a little. Perhaps to something like the following:

   var get_myList = document.getElementById("ORD");
   var target_list = get_myList.getElementsByTagName("SELECT")[0];
   var arr_items = target_list.getElementsByTagName("OPTION");
   arr_items.title = "Choose status based on Order's status";

If the tags have definitely been defined, I'm not sure if there's much value in checking that the objects have been referenced i.e. the 'if (get_myList != null)...' and 'if (target_list != null)...' lines are probably not needed.  Also, unless there is a typo, it doesn't look like the loop is doing anything.

Cheers




Offline TheDarkKnight

  • Full Member
  • ***
  • Posts: 27
  • Forum Citizenship: +0/-0
Re: tool tip for a Prompt
« Reply #4 on: 07 Sep 2010 11:48:30 am »
Yes....u got it right.

My report had to display the loop numbers also....missed that bit in the code..Sorry for that  :).

Thx!