cancel
Showing results for 
Search instead for 
Did you mean: 

How to Disable the SUBMIT Button using the formula.

Former Member
0 Kudos

Hi. Govindu and ohters.

I really appreciate your efforts in helping others.

I am currently working with VC 7.0. Where I am working with Validation of Data.

we have input buttons( fields) like Emp, Earea, Joining date (month & Year), Ending date((month & Year) etc.,

Here we have one submit button 'submit'.

Here what my client asks is unless and until, user fills all details then only

the submit button should be enabled. Otherwise submit button should be in disable mode.

I could be able to write formula for 'submit' button's properties( Disable) like this.

BOOL(IF(LEN(@Emp_code)0 AND LEN(@Earea)0 AND LEN(@Edept)0 AND DSUB(DVAL(@Joining_date), DVAL(@Ending_date),'D')<0 ,false,true))

Here condition is always make sure that 'Joining date' should be greater than 'Ending date' . where it is working fine for all fields except Calender Year month(Joining date & Ending date).

the calender year month format is Example : """" May 2007""""

But it is considering only month But not year.

Can you kindly provide your inputs.

Edited by: Vijay Kumar on Dec 2, 2008 10:51 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I think we need to set a few properties and we might just have a solution:

First, set the Formatting for both the "From" and "To" fields to : DSTR(@Calander_Year_Month, "MON YYYY"), DSTR(@To,"MON YYYY") respectively.

This is done in the Control Properties of both fields (simply double click their names in the right pane)

in the Formatting Tab, choose Custom and then set the formatting expression to the above line.

Then, create a new Expression Box of type Numeric (NUM1) and set its expression to: DSUB(@To,@Calander_Year_Month,'M')

this too is done in the NUM1 control properties, in General Tab, enter the above line in the Expression field.

This way you can set the validation rule to be that the value of the new numeric field NUM1 be Equal or more than 1.

Hope this helps.

Omer.

Former Member
0 Kudos

Hi,

Solution was obtained by adding a "01/" (arbitrary day) to the date field, then using DVAL to convert the string to date, and then using the DSUB function to subtract the dates and return the difference in months.

Regards.

Omer.

Former Member
0 Kudos

Hi,

In the disabled property of you submit button put in the condition for all your field as follow:

ISNULL(var1) OR ISNULL(var2)......

Regards,

Murtuza

Former Member
0 Kudos

Hi. Murtuja.

Thanks for your valuable reply. The formula which you have given that is working for all fields. I have tried this.

But my requirement is here we have Calender month From and To values are there.

Here Calender month from value should be less than to Calender Month To value.

Then only the submit button should be enabled. That I am not getting. Please can you

help me out.

Thanks & Regards.

Former Member
0 Kudos

Hi,

In that condition, you can add one more funtion DSUB which would give you the difference between the 2 dates. eg. DSUB(<data1>,<date2>,<unit>)>0. Based on this you can enable/disable the button.

Regards,

Murtuza

Former Member
0 Kudos

Hi. Murtuza.

Thanks for Your valueable reply. I have already been trying with the following formula.

But still I am not getting expected result.

BOOL(IF(LEN(@Material_Type)<>0 AND LEN(@Plant)<>0 AND LEN(@Vendor)<>0 AND

DSUB(DVAL(@To), DVAL(@Calendar_Year_Month),'D')<0 ,false,true))

I don't have any problem with input buttons( fields) like Material type, Plant, Vendor.

But _'Calender Year Month From' should be less than to 'Calender Month To' then only the submit button should be enabled. Otherwise submit button should be in disable mode. This is not working.

The calender year month format is Example : """" May 2007""""

But it is considering only month But not year.

means It only considering Month only, It is not considering the Year. Please let me know the your information on this.

Thanks and Regards

Edited by: Vijay Kumar on Dec 3, 2008 10:35 AM

Former Member
0 Kudos

Hi. Murtuza.

Can you help me out. We also facing similar problem.

Thanks & Regards