Ok, so I'm pretty much a noob at Javascript, and totally have no idea about XML, so sorry if this is a dumb question.
I have a Javascript file (created by Dymo, the printer company) that will print from a browser to a label printer. I can manually change the information that gets printed. However, I would like it so that it would print whatever information is provided by an HTML form input field, filled by the user.
The problem is the printed data comes from XML within the Javascript.
What I want to know is how I can take the data that the user types into the form, and place it into XML so that I can then print that data. I realize this is a semi-broad question, and potentially difficult.
The Form:
<form name="myform" onsubmit="return false">
QR Data Insertion: <input type="text" name="mytextfield" onchange="checkForm()" autofocus>
</form>
The Javascript (pretty much unnecessary):
<script type="text/javascript" language="JavaScript">
function checkForm() {
var field1 = document.forms['myform'].elements['mytextfield'].value;
alert(field1);
}
</script>
Not sure it will entirely be helpful, but below is a snippet of the XML:
<StyledText>\
<Element>\
<String>HERE IS WHERE I WANT THE FORM DATA TO GO</String>\
<Attributes>\
<Font Family="Arial" Size="12" Bold="False" Italic="False" Underline="False" Strikeout="False" />\
<ForeColor Alpha="255" Red="0" Green="0" Blue="0" />\
</Attributes>\
</Element>\
</StyledText>\