can you get information with javascript of an xml loaded in input before passing it to the php language? And if you can, how do you laugh? what I want is to extract the UUID from the xml and depending on the uuid send the variables to php
can you get information with javascript of an xml loaded in input before passing it to the php language? And if you can, how do you laugh? what I want is to extract the UUID from the xml and depending on the uuid send the variables to php
first create your input type file, then you get the text by FileReader
and then you show it, I'll give you an example
var fileChooser = document.getElementById('fileChooser');
function parseTextAsXml(text) {
var parser = new DOMParser(),
xmlDom = parser.parseFromString(text, "text/xml");
//ahora, extraer los elementos del xmlDom y asignarlos a los imputs
}
function waitForTextReadComplete(reader) {
reader.onloadend = function(event) {
var text = event.target.result;
parseTextAsXml(text);
}
}
function handleFileSelection() {
var file = fileChooser.files[0],
reader = new FileReader();
waitForTextReadComplete(reader);
reader.readAsText(file);
}
fileChooser.addEventListener('change', handleFileSelection, false);
<input id="fileChooser" type="file">