cancel
Showing results for 
Search instead for 
Did you mean: 

Warning message in Adobe form

Former Member
0 Kudos

Hi ,

My form is accessed through portal.

I want a warning message to be displayed when there is no data in the dropdown.

The message can be given

1. At the start when the form opens up Or

2. When the user clicks on the dropdown.

Please help me with this.

Points will be rewarded for useful answers.

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

chintan_virani
Active Contributor
0 Kudos

Thomas,

Lets say you have a field called ddMonth then add the following on its initialize event and change the value to JavaScript.

if(this.rawValue == null || this.rawValue = "")
{
   xfa.host.messageBox("Month is empty");
}

Hope this helps.

Chintan

Former Member
0 Kudos

Thanks Antony and Chintan ,

The problem is that I have a dropdown and not a single field.

I am not defaulting the dropdown with first value in drpdwn so it will be blank initially.

I want the message at this point itself i.e. when the form opens up.

chintan_virani
Active Contributor
0 Kudos

Thomas,

In the initialize event of your drop-down put following code.Change language to javascript.


        var DataBinding = this.bind.ref;
	  
	// the data binding may contain "$data.<root data name>" instead of $record
	DataBinding = DataBinding.replace("$data."+xfa.record.name,"$record");
	DataBinding = DataBinding.replace("$record.", "");
	var itemNode = xfa.form.resolveNode("xfa.datasets.data."+xfa.record.name+".sap-vhlist."+DataBinding.replace(/(\.)/g,"\\.").replace(/(\[\*\])/g,""));
	var size = 0;  
	try 
	{
	    size = itemNode.nodes.length;
	    xfa.host.messageBox("Size is :"+size);
	    if(size == 0)
	    {
   	      xfa.host.messageBox("Month is empty");
	    }
	} 
	catch(e) 
	{
		xfa.host.messageBox("Error");
	}

Former Member
0 Kudos

You can write script in the Form ready event. A one liner using message box method would do :).

- anto.

chintan_virani
Active Contributor
0 Kudos

Thomas,

Did you try out the code? If the problem is resolved please reward and mark the thread as answered.

Chintan

Former Member
0 Kudos

Hi,

Please check the message box method in the adobe designer help.

You may script the necessary message and the error type in the function.

Thanks and regards,

Antony John Isacc