cancel
Showing results for 
Search instead for 
Did you mean: 

Aodbe form Numeric or Decimal Field

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

vaibhav_tiwari
Contributor
0 Kudos

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 Kudos

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 Kudos

Hi,

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

Regards,

Vaibhav Tiwari.

Former Member
0 Kudos

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 Kudos

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 Kudos

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 Kudos

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 Kudos

Hi,

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

Thanks

vaibhav_tiwari
Contributor
0 Kudos

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 Kudos

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 Kudos

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 Kudos

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

Answers (3)

Answers (3)

vaibhav_tiwari
Contributor
0 Kudos

Congrats!!!!

vaibhav_tiwari
Contributor
0 Kudos

Hi,

Will you please be more specific about what you want. What i have understood from your query you have two time fields. You want to enter time in both fields and as its time field value entered can't be more than 2359 i.e. 23:59. Now you want to add values in both the fields that will come to be total hours and minutes and want to display it in third field. For example you enter 12:34 in first time field and 23:45 in second than you want total as (1234+2345 = 3579--> 36 hrs. and 19 minutes). which will be displayed as 36.19 in the numeric field not in time field as its not possible to show more than 23:59 in time field.

Is it what you exactly want or can you please explain it to me in the same manner.

Regards,

Vaibhav Tiwari.

Former Member
0 Kudos

Thanks... this problem is solved..

using...

val=Time2Num(val1.formatteddata."HH:MM:SS")+

Time2Num(val1.formatteddata."HH:MM:SS"))/(60601000).