hi there pals.

i am writing some codes for a scaffolding application. consider i want to implement :

when user click in Delete Link, DB delete that row and make it disappear from the page with Ajax.
i put the whole table on one DIV , and i want the program to refresh only this div (and not other div in the screen) as soon as user click on the DELETE link.
i writes my codes in Symfony Gramework, but it doesnt matter for now.
i can pass the Row_id to the deleteFunction , and delete it from the DB. but i can make it vanished from the screen. because the Ajax link is in the Div itself.
Thanks for your helps in advance

Recommended Answers

All 2 Replies

You can not refresh the div element alone. You can make the require change in div element, dynamically using JavaScript, which is like refreshing the div.

I think this is what u was seeking:

This code shows to delete row from a table.

		<script type="text/javascript">
			// This code should be in the success handler of your Ajax call
			function deleteRow(el) {
				var tEl = document.getElementById('mytable');
				var rEl = el.parentNode.parentNode;
				alert("deleting row: " + rEl.rowIndex);
	<body >
		<div id="slider">
			<table id='mytable' border='1'>
					<td>1.</td><td>d_1</td><td><a href='#' onclick='deleteRow(this);'>Delete</a></td>
					<td>2.</td><td>d_2</td><td><a href='#' onclick='deleteRow(this);'>Delete</a></td>
					<td>3.</td><td>d_3</td><td><a href='#' onclick='deleteRow(this);'>Delete</a></td>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.