Skip to main content

New to this XML stuff help would be greatly appreciated. I'm trying to retrieve an XML form that is embedded on an HTML web page. I'm trying to use "IXMLHTTPRequest" to accomplish this I found the below example of how to this in VB. Can you help me translate this to COBOL. Specifically I'm not sure how to create the "FormData" object.

VB EXAMPLE:

Retrieving a FormData object from an HTML form

To construct a FormData object that contains the data from an existing element represents a document section that contains interactive controls to submit information to a web server." href="/en-US/docs/Web/HTML/Element/form"<form>, specify that form element when creating the FormData object:

var formData = new FormData(someFormElement);

 

For example:

var formElement = document.getElementById("myFormElement");

var request = new XMLHttpRequest();

request.open("POST", "submitform.php");

request.send(new FormData(formElement));

Additional info I've found:

send method

Sends an HTTP request to the server and receives a response.

Syntax

XMLHttpRequest.send(varBody);

Parameters

varBody [in, optional]

Type: any

Any that specifies the body of the message being sent with the request.

Value

Meaning

ArrayBuffer

A binary data. See FileReader.readAsArrayBuffer.

blob

A Blob (binary data object).

Document

A documentnode.

ArrayBufferView

A typed array view of an ArrayBuffer.

string

A DOMString.

FormData

A FormData object.

FormData object

Contains a set of key/value pairs to send form data. The data is sent in the same format as using the submit method on a form with formEnctype set to "multipart/form-data".

 

Syntax

var oMyFormData = new FormData();

 

DOM Information

Inheritance Hierarchy

The FormData does not inherit from any class or interface.

Members

The FormData object has these types of members:

Methods

Methods

The FormData object has these methods.

Method

Description

append

Adds or appends key/value pairs of data to a FormData object for use with XMLHttpRequest.

New to this XML stuff help would be greatly appreciated. I'm trying to retrieve an XML form that is embedded on an HTML web page. I'm trying to use "IXMLHTTPRequest" to accomplish this I found the below example of how to this in VB. Can you help me translate this to COBOL. Specifically I'm not sure how to create the "FormData" object.

VB EXAMPLE:

Retrieving a FormData object from an HTML form

To construct a FormData object that contains the data from an existing element represents a document section that contains interactive controls to submit information to a web server." href="/en-US/docs/Web/HTML/Element/form"<form>, specify that form element when creating the FormData object:

var formData = new FormData(someFormElement);

 

For example:

var formElement = document.getElementById("myFormElement");

var request = new XMLHttpRequest();

request.open("POST", "submitform.php");

request.send(new FormData(formElement));

Additional info I've found:

send method

Sends an HTTP request to the server and receives a response.

Syntax

XMLHttpRequest.send(varBody);

Parameters

varBody [in, optional]

Type: any

Any that specifies the body of the message being sent with the request.

Value

Meaning

ArrayBuffer

A binary data. See FileReader.readAsArrayBuffer.

blob

A Blob (binary data object).

Document

A documentnode.

ArrayBufferView

A typed array view of an ArrayBuffer.

string

A DOMString.

FormData

A FormData object.

FormData object

Contains a set of key/value pairs to send form data. The data is sent in the same format as using the submit method on a form with formEnctype set to "multipart/form-data".

 

Syntax

var oMyFormData = new FormData();

 

DOM Information

Inheritance Hierarchy

The FormData does not inherit from any class or interface.

Members

The FormData object has these types of members:

Methods

Methods

The FormData object has these methods.

Method

Description

append

Adds or appends key/value pairs of data to a FormData object for use with XMLHttpRequest.

I am attaching an example that uses C$XML and one of the sites it reads data from is "www.nws.noaa.gov/.../KMYF.xml&quot; . I believe you could use C$XML without the ActiveX. Another possibility is to use XML Extensions (BIS).c_2400_xml.txt


New to this XML stuff help would be greatly appreciated. I'm trying to retrieve an XML form that is embedded on an HTML web page. I'm trying to use "IXMLHTTPRequest" to accomplish this I found the below example of how to this in VB. Can you help me translate this to COBOL. Specifically I'm not sure how to create the "FormData" object.

VB EXAMPLE:

Retrieving a FormData object from an HTML form

To construct a FormData object that contains the data from an existing element represents a document section that contains interactive controls to submit information to a web server." href="/en-US/docs/Web/HTML/Element/form"<form>, specify that form element when creating the FormData object:

var formData = new FormData(someFormElement);

 

For example:

var formElement = document.getElementById("myFormElement");

var request = new XMLHttpRequest();

request.open("POST", "submitform.php");

request.send(new FormData(formElement));

Additional info I've found:

send method

Sends an HTTP request to the server and receives a response.

Syntax

XMLHttpRequest.send(varBody);

Parameters

varBody [in, optional]

Type: any

Any that specifies the body of the message being sent with the request.

Value

Meaning

ArrayBuffer

A binary data. See FileReader.readAsArrayBuffer.

blob

A Blob (binary data object).

Document

A documentnode.

ArrayBufferView

A typed array view of an ArrayBuffer.

string

A DOMString.

FormData

A FormData object.

FormData object

Contains a set of key/value pairs to send form data. The data is sent in the same format as using the submit method on a form with formEnctype set to "multipart/form-data".

 

Syntax

var oMyFormData = new FormData();

 

DOM Information

Inheritance Hierarchy

The FormData does not inherit from any class or interface.

Members

The FormData object has these types of members:

Methods

Methods

The FormData object has these methods.

Method

Description

append

Adds or appends key/value pairs of data to a FormData object for use with XMLHttpRequest.

Problem is I don't have XML file to get: the XML data is embedded in the HTML page see attached. What I'm after is the XML form: " <form name="sms_cartxml">.


New to this XML stuff help would be greatly appreciated. I'm trying to retrieve an XML form that is embedded on an HTML web page. I'm trying to use "IXMLHTTPRequest" to accomplish this I found the below example of how to this in VB. Can you help me translate this to COBOL. Specifically I'm not sure how to create the "FormData" object.

VB EXAMPLE:

Retrieving a FormData object from an HTML form

To construct a FormData object that contains the data from an existing element represents a document section that contains interactive controls to submit information to a web server." href="/en-US/docs/Web/HTML/Element/form"<form>, specify that form element when creating the FormData object:

var formData = new FormData(someFormElement);

 

For example:

var formElement = document.getElementById("myFormElement");

var request = new XMLHttpRequest();

request.open("POST", "submitform.php");

request.send(new FormData(formElement));

Additional info I've found:

send method

Sends an HTTP request to the server and receives a response.

Syntax

XMLHttpRequest.send(varBody);

Parameters

varBody [in, optional]

Type: any

Any that specifies the body of the message being sent with the request.

Value

Meaning

ArrayBuffer

A binary data. See FileReader.readAsArrayBuffer.

blob

A Blob (binary data object).

Document

A documentnode.

ArrayBufferView

A typed array view of an ArrayBuffer.

string

A DOMString.

FormData

A FormData object.

FormData object

Contains a set of key/value pairs to send form data. The data is sent in the same format as using the submit method on a form with formEnctype set to "multipart/form-data".

 

Syntax

var oMyFormData = new FormData();

 

DOM Information

Inheritance Hierarchy

The FormData does not inherit from any class or interface.

Members

The FormData object has these types of members:

Methods

Methods

The FormData object has these methods.

Method

Description

append

Adds or appends key/value pairs of data to a FormData object for use with XMLHttpRequest.

Problem is I don't have XML file to get: the XML data is embedded in the HTML page see attached. What I'm after is the XML form: " <form name="sms_cartxml">.


New to this XML stuff help would be greatly appreciated. I'm trying to retrieve an XML form that is embedded on an HTML web page. I'm trying to use "IXMLHTTPRequest" to accomplish this I found the below example of how to this in VB. Can you help me translate this to COBOL. Specifically I'm not sure how to create the "FormData" object.

VB EXAMPLE:

Retrieving a FormData object from an HTML form

To construct a FormData object that contains the data from an existing element represents a document section that contains interactive controls to submit information to a web server." href="/en-US/docs/Web/HTML/Element/form"<form>, specify that form element when creating the FormData object:

var formData = new FormData(someFormElement);

 

For example:

var formElement = document.getElementById("myFormElement");

var request = new XMLHttpRequest();

request.open("POST", "submitform.php");

request.send(new FormData(formElement));

Additional info I've found:

send method

Sends an HTTP request to the server and receives a response.

Syntax

XMLHttpRequest.send(varBody);

Parameters

varBody [in, optional]

Type: any

Any that specifies the body of the message being sent with the request.

Value

Meaning

ArrayBuffer

A binary data. See FileReader.readAsArrayBuffer.

blob

A Blob (binary data object).

Document

A documentnode.

ArrayBufferView

A typed array view of an ArrayBuffer.

string

A DOMString.

FormData

A FormData object.

FormData object

Contains a set of key/value pairs to send form data. The data is sent in the same format as using the submit method on a form with formEnctype set to "multipart/form-data".

 

Syntax

var oMyFormData = new FormData();

 

DOM Information

Inheritance Hierarchy

The FormData does not inherit from any class or interface.

Members

The FormData object has these types of members:

Methods

Methods

The FormData object has these methods.

Method

Description

append

Adds or appends key/value pairs of data to a FormData object for use with XMLHttpRequest.

HTML page example:

...

</translate>:</b></span>

 <input type="text" name="SavAsNam">  </td>

<td valign="middle"> <table border="0" cellpadding="0" cellspacing="0" align="left" width="30" height="100%">

<tr>

<td><input name="ButtonClicked1" id="btn_orderSAV99" value="Save Order" type="button" class="btn_160px_png" border="0" onMouseOver="ButtonOver('btn_orderSAV99')" onMouseOut="ButtonOff('btn_orderSAV99')" onMouseDown="ButtonDown('btn_orderSAV99')" onMouseUp="ButtonUp('btn_orderSAV99')" onKeyDown="if (event.keyCode == 13) document.getElementById('btn_orderSAV99').click()" onClick="submitOrdersaveForm('1','SAV99');" /></td>

<!--

<td class="btn_gray4_L" id="btn_orderSAV99_L" width="5"><img src="images2/spacer.gif" width="15" height="1" /></td>

<td class="btn_gray4" name="ButtonClicked1" id="btn_orderSAV99" onClick="submitOrdersaveForm('1','SAV99');" width="100%" onMouseOver="classOver('btn_orderSAV99')" onMouseOut="classOff('btn_orderSAV99')" onMouseDown="classDown('btn_orderSAV99')" onMouseUp="classUp('btn_orderSAV99')"   align="center" nowrap="nowrap" >Save Order</td>

<td class="btn_gray4_R" id="btn_orderSAV99_R" width="5"><img src="images2/spacer.gif" width="15" height="1" /></td>

-->

</tr>

</table>

</td>

<!--<input class="p8" type="submit" value="   Save Order    " name="ButtonClicked1" OnClick="document.ordersave.clearcart.value=1;;document.ordersave.ButtonClicked.value='SAV99';"></td>-->

</tr>

<tr><td> </td></tr>

</form>

</table>

<!--------------  sms Cart Header XML  -------------------->

     <form name="sms_cartxml">

<input type="hidden" name="sms_xmlin" value=" " />

</form>

<!---------------  sms Header XML End   -------------------->

<script type="text/javascript" src="ts2orderconfirm.js?v=0710155603"></script>

<script language="javascript"><!-- hide me

function ClearCart() {

//daab users can have empty saved order desc

if (document.ordersave.SavAsNam.value == "" && document.ordersave.ButtonClicked.value=='SAV99' && !isDaabUser) {

alert("Please enter a name for the saved order.");

return false;

}

if (document.ordersave.clearcart.value == '1') {

sMsg = "Your order has been saved.\\nWould you like to clear the items from your cart?";

var btnclk = document.ordersave.ButtonClicked.value;

top.showConfirmPopup(sMsg, '', 'window.frames.mainbody.processSaveOrder(\\'Yes\\',\\'' btnclk '\\')', 'window.frames.mainbody.processSaveOrder(\\'No\\', \\'' btnclk '\\')');

} else {

return true;

}

}

function IsNumeric(sText){

var ValidChars = "0123456789";

for (i = 0; i < sText.length; i ) {

if (ValidChars.indexOf(sText.charAt(i)) == -1) {

alert("Zipcode must be Numeric. Please enter a valid zipcode.");

return false;

}

....


New to this XML stuff help would be greatly appreciated. I'm trying to retrieve an XML form that is embedded on an HTML web page. I'm trying to use "IXMLHTTPRequest" to accomplish this I found the below example of how to this in VB. Can you help me translate this to COBOL. Specifically I'm not sure how to create the "FormData" object.

VB EXAMPLE:

Retrieving a FormData object from an HTML form

To construct a FormData object that contains the data from an existing element represents a document section that contains interactive controls to submit information to a web server." href="/en-US/docs/Web/HTML/Element/form"<form>, specify that form element when creating the FormData object:

var formData = new FormData(someFormElement);

 

For example:

var formElement = document.getElementById("myFormElement");

var request = new XMLHttpRequest();

request.open("POST", "submitform.php");

request.send(new FormData(formElement));

Additional info I've found:

send method

Sends an HTTP request to the server and receives a response.

Syntax

XMLHttpRequest.send(varBody);

Parameters

varBody [in, optional]

Type: any

Any that specifies the body of the message being sent with the request.

Value

Meaning

ArrayBuffer

A binary data. See FileReader.readAsArrayBuffer.

blob

A Blob (binary data object).

Document

A documentnode.

ArrayBufferView

A typed array view of an ArrayBuffer.

string

A DOMString.

FormData

A FormData object.

FormData object

Contains a set of key/value pairs to send form data. The data is sent in the same format as using the submit method on a form with formEnctype set to "multipart/form-data".

 

Syntax

var oMyFormData = new FormData();

 

DOM Information

Inheritance Hierarchy

The FormData does not inherit from any class or interface.

Members

The FormData object has these types of members:

Methods

Methods

The FormData object has these methods.

Method

Description

append

Adds or appends key/value pairs of data to a FormData object for use with XMLHttpRequest.

I'm not sure what process is currently handling the form submission; however, if you want to process the order through a COBOL program, then, I would recommend using the Xcentrisity Business Information Server (XBIS) for extend product.

XBIS, along with XML Extensions, provides the ability to implement web services in COBOL, so, you could send the web form directly to your COBOL program(s) for processing.

Below is a link to the Xcentrisity Business Information Server for extend data sheet:

www.microfocus.com/.../xcentrisity-business-informati-3589.aspx

Please let me know if you have any questions.