Jump to content
Sign in to follow this  
javi2oo1

Add sample text to ticket field.

Recommended Posts

Hi,
Is it possible to add a text in the description field, for example, giving instructions of what they have to write and, when the user clicks on the field, delete everything so that he can write what he needs?

Thanks!

Share this post


Link to post
Share on other sites

Hi,

 

to add a default text you can use Javascript:

//Add text for a new ticket
function standardDescription() {
<PDM_IF "$args.id" == "0"> 
var d = document.main_form.elements["SET.description"];
d.value  = "What i have to do?\n\n\nI don´t know!";
</PDM_IF>
}

Yo have to set the "keeptags=yes" to the description field when you want to use new lines etc..

<PDM_MACRO name=dtlTextbox hdr="Description" attr=description colspan=5 keeplinks=yes rows=10 size=120 spellchk=yes srchknow=no make_required=yes keeptags=yes>

Load the function in the body section:

<body class="detailro" onload='loadActions();standartDescription();' onunload="unloadActions()">

But i don´t know how you can delete Text with "onfocus()".  It may be possible to use the implemented reset function ?

 

Edited by henning1518

Share this post


Link to post
Share on other sites

Reset the description field on click:

function resetDescription()
{
var d = document.main_form.elements["SET.description"];
d.value = "";
}

Add event to field:

<PDM_MACRO name=dtlTextbox hdr="Description" attr=description colspan=5 keeplinks=yes rows=10 size=120 evt="onclick='resetDescription()'" spellchk=yes srchknow=no make_required=yes keeptags=yes>

That should work.

Edited by henning1518

Share this post


Link to post
Share on other sites

just my 2 cents, If you want to place some text on form:

var zColsCount = 1; // columns count
detailRowHdr("Some Header", zColsCount);
detailSetRowData("I'm kind of useful tip. Also I support <b><i>html tags</i></b>.");

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×