/    Sign up×
Community /Pin to ProfileBookmark

Hello Guys, I need to make one, two or maybe three rows disappear after pressing a button, depending on the situation. Does anybody have an idea of how I could do that?

Click [URL=http://www.romasystems.com.br/testPage.html]here[/URL]
to have an ideia of what I´m talking about. I already have something working, but it is not not quite what I need.

Thanks a lot for any help.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@steelersfan88Dec 27.2004 — You'd simply remove each node (row) from its parent (table). Code:<script type="text/javascript">

function removeRow(r) {
r--;
var t = document.getElementById('tbl').tBodies[0];
if(r<0 || r>=t.rows.length)
return false;
t.removeChild(t.rows[r]);
return false;
}

</script>
<script type="text/javascript">

// write the table
document.write('<table id="tbl">n <tbody>n');
for(var i=1;i<10;i++) {
document.write(' <tr>n');
for(var j=1;j<10;j++) {
document.write(' <td>'+j+','+i+'</td>n');
}
document.write(' </tr>n');
}
document.write(' </tbody>n</table>n');

</script>

<form onsubmit="return removeRow(this.r.value);">
<fieldset style="width:300px;text-align:center;"><legend>Remove a Row</legend>
<label>Which row? <input type="text" name="r"></label><br>
<button type="submit">Delete!</button>
</fieldset>
</form>
That should show you something on how it is done ...
×

Success!

Help @joao_br spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...