« first day (2542 days earlier)      last day (1575 days later) » 

05:26
<body>
Quantity <input type="text" name="p_tquan" id="totquan">
<br>
Select number of chemicals <select class="selectbtn" onchange="showtxt(this.value)">
<option>Select One</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<table>
<tr>
<th><label id="label1" style='display:none'>Serial No</label></th>
<th><label id="label2" style='display:none'>Chemicals</label></th>
<th><label id="label3" style='display:none'>Percentage</label></th>
<th><label id="label4" style='display:none'>Quantity</label></th>
1 message moved from JavaScript
05:59
2.style.display='block';
b3.style.display='block';
b4.style.display='block';
}
else{
label1.style.display='none';
label2.style.display='none';
label3.style.display='none';
label4.style.display='none';
a1.style.display='none';
a2.style.display='none';
a3.style.display='none';
a4.style.display='none';
b1.style.display='none';
b2.style.display='none';
b3.style.display='none';
b4.style.display='none';
}
1 message moved from Test My Bot
 
2 hours later…
@Natty tp
 
1 hour later…
09:33
How can I simultaneously add event for an input field and catch its value without writing document.getEle... twice?
``` // Input Event Listeners and Model Updating
let a = '';
let number_of_oranges_select = document.getElementById('number-of-oranges');
number_of_oranges_select.addEventListener('input', function() {
a = number_of_oranges_select.value;
console.log(a);
}) ```
1 message moved from JavaScript
delete ----^
 
7 hours later…
16:43
I'm trying to do something really simple but for some reason I'm stuck and I need some help.

So I just try to upload an XML file using react hooks but for some reason the state in which I save the input file is always empty. Here is what I do:

<div className="uploadXML">
<input type="file" onChange={uploadXMLHandler}/>
</div>

Here is the JS
const [xmlUpload, setXmlUpload] = useState(null);

const uploadXMLHandler = e => {
setXmlUpload(e.target.files[0]);
};
1 message moved from JavaScript
const uploadXMLHandler = e => {
setXmlUpload(e.target.files[0]);
console.log(xmlUpload);
};
1 message moved from JavaScript
17:48
Can anyone figure out why I can't get remove-button of for my js added forms?

let add_button = document.getElementById('custom-add-button');
let container = document.getElementById('custom-container');
add_button.addEventListener('click', e => {
let form = document.createElement('div');
form.className = `custom`;
form.innerHTML = custom_form_string;
container.insertBefore(form, add_button);
console.log(form);
})
let stuff = document.querySelectorAll('.custom-remove-button');

stuff is only the first form (not added via js)
1 message moved from JavaScript

« first day (2542 days earlier)      last day (1575 days later) »