Click here to Skip to main content
15,796,456 members
Home / Discussions / JavaScript
   

JavaScript

 
Questiondrop down list and submit button Pin
prasad penkey4-Dec-23 3:33
prasad penkey4-Dec-23 3:33 
AnswerRe: drop down list and submit button Pin
Richard MacCutchan4-Dec-23 4:08
mveRichard MacCutchan4-Dec-23 4:08 
AnswerRe: drop down list and submit button Pin
Andre Oosthuizen5-Dec-23 9:50
mveAndre Oosthuizen5-Dec-23 9:50 
GeneralRe: drop down list and submit button Pin
Richard Deeming23hrs 58mins ago
mveRichard Deeming23hrs 58mins ago 
GeneralRe: drop down list and submit button Pin
Andre Oosthuizen14hrs 58mins ago
mveAndre Oosthuizen14hrs 58mins ago 
Questiondropdown Pin
prasad penkey4-Dec-23 2:39
prasad penkey4-Dec-23 2:39 
AnswerRe: dropdown Pin
Richard Deeming4-Dec-23 2:45
mveRichard Deeming4-Dec-23 2:45 
Questionjavascript alert() not showing Pin
Ashish Tiwari Aug20233-Dec-23 7:00
Ashish Tiwari Aug20233-Dec-23 7:00 
AnswerRe: javascript alert() not showing Pin
Dave Kreskowiak3-Dec-23 10:07
mveDave Kreskowiak3-Dec-23 10:07 
QuestionInserting HTML from a fetch gives me extra blank rows..? Pin
William Morris 202124-Oct-23 19:58
William Morris 202124-Oct-23 19:58 
AnswerRe: Inserting HTML from a fetch gives me extra blank rows..? Pin
enhzflep28-Oct-23 0:00
enhzflep28-Oct-23 0:00 
AnswerRe: Inserting HTML from a fetch gives me extra blank rows..? Pin
Richard Deeming30-Oct-23 0:16
mveRichard Deeming30-Oct-23 0:16 
GeneralRe: Inserting HTML from a fetch gives me extra blank rows..? Pin
Richard MacCutchan30-Oct-23 1:53
mveRichard MacCutchan30-Oct-23 1:53 
QuestionInserting HTML from a fetch gives me extra blank rows..? Pin
William Morris 202124-Oct-23 9:31
William Morris 202124-Oct-23 9:31 
Making a fetch call and getting html back, like so:

HTML
<tr>
	<td class="heading">JGServices</td>
	<td class="numeric-amount">
		<input type="text" size=10 value="99.00" onfocus="this.blur()">
	</td>
<tr>
<tr>
	<td class="heading">ShippingHandling</td>
	<td class="numeric-amount">
		<input type="text" size=10 value="25.00" onfocus="this.blur()">
	</td>
<tr>
<tr>
	<td class="heading">District</td>
	<td class="numeric-amount">
		<input type="text" size=10 value="123.00" onfocus="this.blur()">
	</td>
<tr>
<tr>
	<td class="heading">Penalty</td>
	<td class="numeric-amount">
		<input type="text" size=10 value="250.00" onfocus="this.blur()">
	</td>
<tr>


...then using javascript to append it to the TBODY tag of the relevant table. I've tried two ways:

JavaScript
let T = document.getElementById('tblFees');
let t = T.querySelector('tbody');
let ih = t.innerHTML;
ih += data;
t.innerHTML = ih;


...and...

JavaScript
let T = document.getElementById('tblFees');
let t = T.querySelector('tbody');
t.insertAdjacentHTML('beforeend', data);


And in both cases, the browser renders it like this:

HTML
<tr>
	<td class="heading">JGServices</td>
	<td class="numeric-amount">
		<input type="text" size="10" value="99.00" onfocus="this.blur()">
	</td>
</tr>
<tr></tr>
<tr>
	<td class="heading">ShippingHandling</td>
	<td class="numeric-amount">
		<input type="text" size="10" value="25.00" onfocus="this.blur()">
	</td>
</tr>
<tr></tr>
<tr>
	<td class="heading">District</td>
	<td class="numeric-amount">
		<input type="text" size="10" value="123.00" onfocus="this.blur()">
	</td>
</tr>
<tr></tr>
<tr>
	<td class="heading">Penalty</td>
	<td class="numeric-amount">
		<input type="text" size="10" value="250.00" onfocus="this.blur()">
	</td>
</tr>
<tr></tr>


I can't figure out why or how to stop the extra, empty rows from appearing. Anyone have any ideas?

- Bill

Measure with a micrometer. Mark with a crayon. Cut with an ax.
QuestionMoving a <div> from right edge of screen to left slowly? Pin
Blake McKenna27-Sep-23 18:51
Blake McKenna27-Sep-23 18:51 
AnswerRe: Moving a <div> from right edge of screen to left slowly? Pin
Steve Raw21-Oct-23 18:39
professionalSteve Raw21-Oct-23 18:39 
QuestionJasmine - monitor all calls of a method? Pin
NoMoreStackOverflow22-Sep-23 1:25
NoMoreStackOverflow22-Sep-23 1:25 
AnswerRe: Jasmine - monitor all calls of a method? Pin
jschell23-Sep-23 15:25
jschell23-Sep-23 15:25 
GeneralRe: Jasmine - monitor all calls of a method? Pin
NoMoreStackOverflow23-Sep-23 21:33
NoMoreStackOverflow23-Sep-23 21:33 
AnswerRe: Jasmine - monitor all calls of a method? Pin
jschell25-Sep-23 9:10
jschell25-Sep-23 9:10 
GeneralRe: Jasmine - monitor all calls of a method? Pin
NoMoreStackOverflow25-Sep-23 16:29
NoMoreStackOverflow25-Sep-23 16:29 
QuestionMutation Observer, editing a value Pin
jkirkerx15-Aug-23 12:49
professionaljkirkerx15-Aug-23 12:49 
AnswerRe: Mutation Observer, editing a value Pin
jkirkerx15-Aug-23 13:07
professionaljkirkerx15-Aug-23 13:07 
GeneralRe: Mutation Observer, editing a value Pin
Richard Deeming15-Aug-23 22:36
mveRichard Deeming15-Aug-23 22:36 
GeneralRe: Mutation Observer, editing a value Pin
jkirkerx16-Aug-23 7:33
professionaljkirkerx16-Aug-23 7:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.