Error while Submitting using Code

B

Ben

Hello!

im having this tres annoying problem submitting a form, i have all the
form information and it works on any filename that doesnt have a
colon, but the http:// has a colon and works fine, here is my code:

if( XDocument.DOM.selectSingleNode("/my:myFields/
my:Exported_date").text != "" )
{
if ( XDocument.DOM.selectSingleNode("/my:myFields/my:field117").text
== "CIP Partners" )
{
if ( XDocument.DOM.selectSingleNode("/my:myFields/
my:ExpPerson").text != XDocument.DOM.selectSingleNode("/my:myFields/
my:Assign_Job").text )
{
var fSuccessful = false;
// Set the URL of the file that you want to submit here.
var strUrl11 = "https://localhost/formLib1";
var strUrl12 = "202222-2222-2-2-2-2T22:2.xml"
var strUrl13 = strUrl12.replace(":", ":");
var strUrl1 = (strUrl11 + strUrl13);
XDocument.UI.Alert("Step1");
var strr = XDocument.DOM.selectSingleNode("/my:myFields/
my:form_name").text;
var strrr = ".xml";
var strUrl = strUrl1.concat(strr, strrr);
var strUrl2 = (strUrl1 + strr + strrr);
XDocument.UI.Alert(strUrl1);
try
{
var oXmlHttp = new ActiveXObject("MSXML2.XMLHTTP");

oXmlHttp.Open("HEAD", strUrl1, false);
oXmlHttp.Send();
XDocument.DOM.selectSingleNode("/my:myFields/my:ExpPerson").text =
XDocument.DOM.selectSingleNode("/my:myFields/my:Assign_Job").text;
if (oXmlHttp.Status == 404)
{
// Put the document in the WSS document library.
oXmlHttp.Open("PUT", strUrl1, false);
oXmlHttp.Send(XDocument.DOM.xml);

// A 200 status code or a 201 status code indicates that the
form has been submitted successfully.
if (oXmlHttp.Status == 200 || oXmlHttp.Status == 201)
{
fSuccessful = true;
}
}
}
catch (ex){}

if (fSuccessful)
{
XDocument.UI.Alert("Document submitted successfully.");
eventObj.ReturnStatus = true;

}
else
{
XDocument.UI.Alert("Document NOT submitted successfully.");
eventObj.ReturnStatus = false;
}
}else{XDocument.UI.Alert("Please Fill in the Planned Implementation
Date Before Submitting");}
}else{XDocument.UI.Alert("Step3");}
}else{XDocument.UI.Alert("Step2");}

I would appreciate any assistance i could be given on this matter

the problem is i need to use colons as this is meant to be an upgrade
to an existing form so i need this new sae precedure to replace the
old forms instead of creating new ones, but the old forms use a now()
function in the file name :/, could html codes be used, as you can see
i tried using them but im n idiot >.<

Best regards

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top