This topic is locked

Custom Buttons

2/25/2019 2:05:13 PM
PHPRunner General questions
T
taumic author

Hello,
i inserted two butons and want to extend them with mouseover-tooltips. Can someone please point in the right direction?
I tried the following in the JavaScriptOnLoadEvent:


$("a[id^=custom_button]").attr('title', 'Show existing customer documents');
$("a[id^=custom_button1]").attr('title', 'Create new documents for the customer');


But unfortunately, it doesn't work.
I don't want to interfere with HTML via the EDITOR.
Many thanks in advance
Michael

lefty 2/25/2019



Hello,
i inserted two butons and want to extend them with mouseover-tooltips. Can someone please point in the right direction?
I tried the following in the JavascriptonloadEvent:


$("a[id^=custom_button]").attr('title', 'Show existing customer documents');
$("a[id^=custom_button1]").attr('title', 'Create new documents for the customer');


But unfortunately, it doesn't work.
I don't want to interfere with HTML via the EDITOR.
Many thanks in advance
Michael


Easiest Way is HTML : Try this // I know you mentioned don't want to use but it is a simple insert.
Go to your button in HTML via the editor , and just look for your New Button <A type="button"title="Tooltip message here" .................. // leave everything else alone fastest way to do it .





So all you are adding in between the button code is**title="Tooltip message here"





Go back to Design mode / hover over button should come right up.**

T
taumic author 2/26/2019

Thank you, John,
I'm looking for an alternative, because you have to repeat this every time (and who knows after a long time what you changed manually) if you have to reset the EDITOR screen (e.g. when updating to a new PHPR version).
So if someone knows an alternative .....
Best regards
Michael

Sergey Kornilov admin 2/26/2019

Modifying HTML code is definitely a bad idea. Your Javascript approach will work, you just need to make sure your code is correct. Here is how to figure out correct item attributes.
Build your application and open it in a web browser. Right click on this button in web browser and choose 'Inspect element'. It will show you HTML behind button's code and all its attributes. Now building correct code is very easy, this screenshot explains it all.


And here is the code itself:

$("span[data-itemid=custom_button1]").attr('title', 'my title');
T
taumic author 2/26/2019

Thank you Sergey - Fantastic!
With your correct syntax this now works in "JavaScript onLoad event" .
What I noticed is that the detail links for the child records have to use a different syntax - can that be and could you give it to me? I know that's a lot to ask for, but a lot of customers attach great importance to tooltips and it strengthens customer satisfaction. Maybe this topic would also be something to support PHPR system-wide uniformly (if there is a lot of time <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=87225&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> )
Greetings and good night from Germany
Michael