Hi All,
I am generating the below code in the xml using javascript
<Validation>
<Field>Firstname-Y</Field>
<Message>Didnt Fill FirstName</Message>
</Validation>
<Validation>
<Field>Secondname-Y</Field>
<Message>Didnt Fill SecondName</Message>
</Validation>
<Validation>
<Field>Address-Y</Field>
<Message>Didnt Fill Address</Message>
</Validation>
<Validation>
<Field>Comments-Y</Field>
<Message>Didnt Fill Comments</Message>
</Validation>
When the xml is generated,I all the markups "<" and ">" are converted into < and >
The code looks like this
<Validation>
<Field>Firstname-Y</Field>
<Message>Didnt Fill FirstName</Message>
</Validation>
<Validation>
<Field>Secondname-Y</Field>
<Message>Didnt Fill SecondName</Message>
</Validation>
<Validation>
<Field>Address-Y</Field>
<Message>Didnt Fill Address</Message>
</Validation>
<Validation>
<Field>Comments-Y</Field>
<Message>Didnt Fill Comments</Message>
</Validation>
How to overcome this ?.I tried using the ascii equvalent and unicode equivalent for those two markups.But got the same result.
Please can anyone suggest how to get the symbols as it is in the generated xml.
Its very urgent requirement for me.
Thanks,
Manjula
Views
Replies
Total Likes
Fix your javascript.
Post it here if you need help.
Views
Replies
Total Likes
var errorarray=new Array();
var errormsgarry=new Array();
var c=0;
var msgbox="";
var strng="";
if(firstName.rawValue==null)
{
c=c+1;
errorarray[0]="Firstname-Y";
errormsgarry[0]="Didnt Fill FirstName";
msgbox="FirstName " + <br/>;
}
if(secondName.rawValue==null)
{
c=c+1;
errorarray[1]="Secondname-Y";
errormsgarry[1]="Didnt Fill SecondName";
msgbox= msgbox + " SecondName " + <br/>;
}
if(Address.rawValue==null)
{
c=c+1;
errorarray[2]="Address-Y";
errormsgarry[2]="Didnt Fill Address";
msgbox= msgbox + " Address " + <br/>;
}
if(Comments.rawValue==null)
{
c=c+1;
errorarray[3]="Comments-Y";
errormsgarry[3]="Didnt Fill Comments";
msgbox= msgbox + " Comments" + <br/>;
}
if(c>0)
{
var check=xfa.host.messageBox("Please enter the fields " + msgbox + " still you want to continue ?","Alert","3","2");
if(check==3)
{
xfa.host.messageBox("Please fill the fields");
}
else
{
for(var i=0;i<errorarray.length;i++)
{
if(errorarray[i]!=null)
{
strng= strng + String.fromCharCode(60)+"Validation"+String.fromCharCode(62)+String.fromCharCode(60)+"Field"+String.fromCharCode(62) + errorarray[i]
+String.fromCharCode(60) +"\/Field"+String.fromCharCode(62)+String.fromCharCode(60)+"Message"+String.fromCharCode(62)+ errormsgarry[i] +String.fromCharCode(60)+"\/Message"+String.fromCharCode(62)+String.fromCharCode(60)+"\/Validation"+String.fromCharCode(62);
}
}
xfa.host.messageBox(strng);
fnameValid.rawValue=strng;
EmailSubmitButton1.execEvent("click");
}
}
else
{
errorarray.length=0;
errormsgarry.length=0;
EmailSubmitButton1.execEvent("click");
}
This is my javascript code and I am facing problem in the section
strng= strng + String.fromCharCode(60)+"Validation"+String.fromCharCode(62)+String.fromCharCode(60)+"Field"+String.fromCharCode(62) + errorarray[i]
+String.fromCharCode(60) +"\/Field"+String.fromCharCode(62)+String.fromCharCode(60)+"Message"+String.fromCharCode(62)+ errormsgarry[i] +String.fromCharCode(60)+"\/Message"+String.fromCharCode(62)+String.fromCharCode(60)+"\/Validation"+String.fromCharCode(62);
Views
Replies
Total Likes
Nothing wrong there. What does EmailSubmitButton1.execEvent("click") look like?
Views
Replies
Total Likes
like after concating the string,I am submitting the form by using the email submit button to generate an xml.
That generated xml will have "<" for "<" and ">" for ">" and my xml looks like this
<Validation>
<Field>Firstname-Y</Field>
<Message>Didnt Fill FirstName</Message>
</Validation>
<Validation>
<Field>Secondname-Y</Field>
<Message>Didnt Fill SecondName</Message>
</Validation>
<Validation>
<Field>Address-Y</Field>
<Message>Didnt Fill Address</Message>
</Validation>
<Validation>
<Field>Comments-Y</Field>
<Message>Didnt Fill Comments</Message>
</Validation>
which should be
<Validation>
<Field>Firstname-Y</Field>
<Message>Didnt Fill FirstName</Message>
</Validation>
<Validation>
<Field>Secondname-Y</Field>
<Message>Didnt Fill SecondName</Message>
</Validation>
<Validation>
<Field>Address-Y</Field>
<Message>Didnt Fill Address</Message>
</Validation>
<Validation>
<Field>Comments-Y</Field>
<Message>Didnt Fill Comments</Message>
</Validation>
Thanks,
Manjula
Views
Replies
Total Likes
There's nothing wrong with your javascript, nor the xml you're generating. The problem lies in injecting xml code into a text field and expecting Acrobat to simply pass it on to the xml string. Any other behaviour than the current would leave the form's application open to exploits.
Consider a scenario in which a form has a write-protected field called InterestRate ("admins only") and an open field called "Firstname".
A user could then enter the following into the Firstname field:
Paul</FirstName><InterestRate>0.02</InterestRate><FirstName>Paul
If Acrobat would behave the way you want it to, the following xml code would be generated:
<FirstName>Paul</FirstName><InterestRate>0.02</InterestRate><FirstName>Paul</FirstName>
Valid, well-formed and Voila! Paul just set his own interest rate by using xml injection.
I won't ask why you're generating validation messages and passing them along the form data, but you need to approach from a different direction. Either a) let the system receiving the e-mail generate the validation message or b) let that system transform the validation message back to valid xml.
Views
Replies
Total Likes
Thanks for your reply,I got your point.I am new to livecycle so I dont have any idea of how to get the output for that scenario
Thanks,
Manjula
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies