[Rt-devel] Question About Validate Custom Field

Tina Schade Tina.Schade at gmx.de
Fri Aug 6 02:02:40 EDT 2004


Hi Pablo,

Sorry, but I  don´t understand for what you need the pop up window.

If the user have to put a date and a time in the two customfields by creating 
a ticket, so you need only to create the two customfields as free form 
single. You can get the input-strings in init-block of Display.html from 
parameter ARGS{customfield_id_value} (see for $NamePrefix in 
EditCustomFields). Then you can translate in init-block the string in a valid 
date-format or what ever.

I you want that the user can get the date from a customfield, but the date is 
not a fix value, than you can create also a customfield with free form single 
and set the value to the customfield in the init-block of EditCustomField. 
You have to set your date-value only to $Default. Naturally you have to check 
which customfieldname it is, that you can set the default value. 
If you have more values to set, create a customfield select single/multiple. 
Check the customfieldname and use the Funktion Customfield->AddValue. Firstly 
you have to check if there are values, if yes so delete them with 
CustomField->DeleteValue(valueid).

If you need I can send you some code, but maybe it is to specifically. I hope 
I could help you. Ask me if you have questions.

Best regards,
Tina

Am Donnerstag, 5. August 2004 18:19 schrieb Pablo Silva:
> Hi Tina!
>
> Thanks for your comments, my problem is:
>
> I have 2 custom fields, where I must to input dates
> and hours, the formats are:
>
> custom field 1 : dd-mm-yyyy
> custom field 2 : hh:mm
>
> where dd (day), mm (month), yyyy (year), hh (hour), mm
> (minutes).
>
> Searching the source code, I finded one file, where I
> may insert javascript code, for example if you see the
> file
> /opt/rt3/share/html/Ticket/Elements/EditCustomField
>
> line number: 30 and insert a javascript code for
> example a popup window with a message "Hola"
>
> if ($CustomField->Type eq 'FreeformSingle') {
>      29       <input
> name="<%$NamePrefix%><%$CustomField->Id%>-Value"
>      30         size="<%$Cols%>"
> OnClick="javascript:alert('Hola');"
>
> It's works, but it's very hard to implement, with the
> templates exists other form for to do the same?
>
> I feel as Hamblet... to do or not to do .... ;-)
>
> Thanks in advance!
> Pablo
>
> --- Tina Schade <Tina.Schade at gmx.de> wrote:
> > Am Donnerstag, 5. August 2004 16:25 schrieb Pablo
> >
> > Silva:
> > > Hi Michel!
> > >
> > >  Thank's for your answer, I have a question about
> > > this.
> > >
> > > In my work, we need a template with 2 custom
> >
> > fields,
> >
> > > for date entry, we want when an user make a click
> >
> > in
> >
> > > these  fields, open a pop up windows, for to
> >
> > select a
> >
> > > date.
> >
> > Hello Pablo,
> >
> > Does I understand you right, that you want select a
> > value from a
> > cusomfield-selectbox and work with the value which
> > the user selected??
> >
> > I don´t know if you want to fill the customfield
> > dynamically (or for what do
> > you need a pop up window?) or if your problem is
> > more to show new data to the
> > selected value.
> >
> > I made some of such things. Maybe I can help you.
> >
> > Greetings,
> > Tina
> >
> > > Do you an example for this?, where I can find
> > > documentation for to work with templates in RT?
> > >
> > > Thank's in advance
> > >
> > > Pablo
> > > --- "Michael S. Liebman"
> >
> > <m-liebman at northwestern.edu>
> >
> > > wrote:
> > > > At 06:23 PM 8/4/2004, Pablo Silva wrote:
> > > > >    I want to vallidate two custom fields, my
> >
> > first
> >
> > > > >question is it possible?
> > > >
> > > > By validate do you mean check that a value has
> >
> > been
> >
> > > > entered or conforms to
> > > > specified pattern? Most people do that through
> > > > custom JavaScript.
> > > >
> > > > Michael
> > > >
> > > > --
> > > > Michael S. Liebman
> > > > m-liebman at northwestern.edu
> > > >                  http://msl521.freeshell.org/
> > > > "I have vision and the rest of the world wears
> > > > bifocals."
> > > >         -Paul Newman in "Butch Cassidy & the
> > > > Sundance Kid"
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > New and Improved Yahoo! Mail - Send 10MB messages!
> > > http://promotions.yahoo.com/new_mail
> > > _______________________________________________
> > > Rt-devel mailing list
> > > Rt-devel at lists.bestpractical.com
>
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
>
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Read only the mail you want - Yahoo! Mail SpamGuard.
> http://promotions.yahoo.com/new_mail



More information about the Rt-devel mailing list