Expand my Community achievements bar.

Customizing submit as XML button

Avatar

Level 9

Hello All,

I have a form where several fields are there. I am using a sample XML to embedded the data. After filling the form the user has to submit the form data as XML. But problem is when the user submits the data entire embedded xml data are coming. Is it possible to customize the submit xml in a such a way it will only send the xml of those data that are only filled in the form, not the entire embedded xml ? I am really scratching my head. Could anybody please help me ?

Thanks.

Bibhu.

5 Replies

Avatar

Level 6

Try setting the binding of the fields you don't want included to none, as opposed to normal or global.

Avatar

Level 9

Hello Geroge,

I want all the values of the fields that are present in the form. My concern is how to extract the xml data of only those field values, not the whole xml that is embeded.

Thanks.

Bibhu.

Avatar

Level 6

I see have misread your question. Are you saying that you only want to include the name/value pairs for fields that have a non-blank (non-null?, non-zero?) value? If so, how are you defining whether or not a field has a value, exactly? For text fields, it fairly straightforward; either there is something in the field or it is blank. For other fields, it's not so easy. In any case, you could programmatically loop through the fields and set the binding to none for the empty fields, then go forward with the submit.

I have to ask: why do you want to do this? Why can't the process that reads the XML simply disregard the empty fields?

Avatar

Level 9

Hello Geroge,

Let me clarify my questions one again.

I have a dropdown. Say CustomerID.

There are few related fields like CustomerName, CustomerEmail,CustomerPhoneno..etc...

I am using a XML to embed the data.


The XML contains all the node related to customer.

Suppose In the dropdown value of CustomerID the user selects 1.

Basing upon this selection all the associated entries are filled.

No field is left blank.

But when the user submits the data as XML all the embeded xml sample data along with the field values are sent.

As the sample xml data I am embeding it's huge.

Hence I want only those field values as XML (Not the XML sample data I am embeding.)It's not related to any blank field.

I hope am bit clear in my question.

Thanks.

Bibhu.

Avatar

Level 6

I see now. I'm afraid I can't help in that case.