cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi experts,

I am new to adobe form. I want to display, if i enter 1234 ,it will be displayed 12.34 .Can you please suggest me?

Thnaks.

Hans

0 Likes
View Entire Topic
vaibhav_tiwari
Contributor
0 Likes

Hi Hans Bauer,

Do the following:

1. Take the field as Numeric Field or Decimal field from Library.

2. Select the field from Hierarchy.

3. Go to menu> windows> Script Editor.

4. Choose Exit event in the script editor.

5. now write the following code in the exit event of the numeric field/decimal field.

$.rawValue = $.rawValue/100

Thats all what you have to do.

Hope it will solve your problem.

Regards,

Vaibhav Tiwari.

Former Member
0 Likes

Hi Vaibhav Tiwari ,

Thaks For ur quick reply. I want to send message also if not this format. Please tel me....

Thanks.

Hans

vaibhav_tiwari
Contributor
0 Likes

Hi,

Can you please explain about the format and what you want.

Regards,

Vaibhav Tiwari.

Former Member
0 Likes

Hi Vaibhav Tiwari ,

Thanks for ur frequent reply... My formate is XX.XX.The last two digits are minuts.So the last two digit will be display lessthan 60 if not give error message . I set menu path via object -->value --> display pattern -->99.99.

Let me know if u not understand?

Thanks.

Hans

vaibhav_tiwari
Contributor
0 Likes

Hi Hans,

If you want to display time in that field then use date and time field instead of decimal/numeric field and make following configurations:

1. Select the Date and time field and go to Object palette.

2. In the field tab of object palette set display pattern and edit pattern as "HH:MM".

3. Select value tab in the object palette and set validate pattern to "HH:MM".

4. Now below the validate pattern there is textbox validate pattern message. Put there the message you want to display.

Hope this will work. If there is any restriction to use decimal field only then do tell me.

Regards,

Vaibhav Tiwari.

Former Member
0 Likes

Hi,

Yes..but my first two digit 1 to 99 hours.so only i went to numeric or decimal. Any suggestions.

Thanks.

vaibhav_tiwari
Contributor
0 Likes

Hi Hans,

Use the following script at the exit event of the numeric field:

if( mod($.rawValue,100) > 60)
then
	$host.messageBox( "Wrong value entered" );
	$host.setFocus("NumericField1");
else 
	$.rawValue = $.rawValue/100;
endif

hope it will be helpful.

Regards,

Vaibhav Tiwari.

Former Member
0 Likes

Hi,

Thanks for ur helpful reply... How to add two times.(data type - date/time field). Please help me?

Thanks

vaibhav_tiwari
Contributor
0 Likes

HI,

Are you asking about adding Date/time field or numeric field. What I understand is that you want to add two Numeric fields on the adobe form. For that you have to write the same script at the exit event of both the fields.

Regards,

Vaibhav Tiwari.

Former Member
0 Likes

Hi,

Thanks for frequent reply... I am asking about date & time field... Please tel me how to add two date & time fields.

Thanks

vaibhav_tiwari
Contributor
0 Likes

Hi,

Do you want to add their values or want to add them on the form.

if you want to add their values then just write the follwing script at the event where you want assigning this value to the field you want :

Num2Time( (Time2Num(DateTimeField1.rawValue) + Time2Num(DateTimeField2.rawValue)) , "HH:MM:SS")

Regards,

Vaibhav Tiwari.

Former Member
0 Likes

Hi,

I heve done following code.

Numfield1.rawValue = Num2Time( (Time2Num(DateTimeField1.rawValue) + Time2Num(DateTimeField2.rawValue)) , "HH:MM:SS")

Get answer in numeric field. but could not come the answer.

Please suggest me...if any mistake