cancel
Showing results for 
Search instead for 
Did you mean: 

Mandatory fields Java script

Former Member
0 Kudos

Hi,

I have few fields in my form (ZCI type) which Im using in WD ABAP which are mandatory. For making field mandatory I have made property User Enter Required from Value tab of Object palette.

And I have a submit button from Webdynpro Native palette. When I click it the validations are not happening.

My scenario is, I want to maintain mandatory field validations at the form level and the business validations from BAPI .

So, If I click the submitButton (webdynpro Native) it should check the mandatory fields first if fields are filled then it should trigger BAPI.

Now it is directly trigerring the BAPI and its validations are displaying on webdynpro.

Can some one give me sample code in javascript for getting this mandatory property.

And I think setting the property in object palette for mandatory, only works for normal submit button if Im not wrong.

Regards,

Ravi.

Accepted Solutions (1)

Accepted Solutions (1)

chintan_virani
Active Contributor
0 Kudos

Ravi,

Searching would have helped you solve this issue. Anyways you can write following code in JavaScript either in the exit event of the field or Submit event.

if(TextField1.rawValue == null || TextField1.rawValue == "")
{
   xfa.host.messageBox("TextField1 is mandatory.Please enter some value"); 
}

Chintan

Answers (0)