473,513 Members | 4,753 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

please help

Hi All

I had an HTMLpage with a table consisting of 5 columns

the first two columns are images add and delete

on the page load i have only one row for the table

when i click the add button then a clone is created below it

not what i want is as soon as i add some rows and fill them with
numeric values

and click the ok button

the table should be sorted basing on the values of the third column
here the code

<html>
<head>
<title>Custom Deciling</title>
<script type="text/javascript">
function cloneRow(theCell)
{
if( document.createElement && document.childNodes )
{
var thisRow = theCell.parentNode;
var newElement = thisRow.cloneNode(true);
thisRow.parentNode.insertBefore(newElement,thisRow .nextSibling);
var nr = document.frmadd.textmin.length
cleanRow(newElement,nr);
}
}
function cleanRow(n,p)
{
if (n.id)
n.id = n.id.split('-')[0] + '-' + p;
if (n.name)
n.name = n.name.split('-')[0] + '-' + p;
if (n.value)
n.value = '';
for (var i=0; i<n.childNodes.length; i++) {
cleanRow(n.childNodes[i],p);
}
}
function deleteRow(theCell)
{

var nr = document.frmadd.textmin.length
if (nr==undefined || nr==1)
{
alert("Operation Cannot be Performed");
return;
}
else
{
if( document.createElement && document.childNodes )
{
var thisRow = theCell.parentNode;
thisRow.parentNode.removeChild(thisRow);
}
}
}
</script>
</head>
<body bgcolor="#00265c" >
<form name="frmadd">
<table border="0" align=center>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td align=center><Font face=verdana color=yellow
size=1>Min</font></td>
<td align=center><Font face=verdana color=yellow
size=1>Max</font></td>
<td align=center><Font face=verdana color=yellow
size=1>Decile</font></td>
</tr>
<tr>
<td onclick="cloneRow(this);"><img src="../../images/add.gif"
border="0" WIDTH="51" HEIGHT="23"></td>
<td onclick="deleteRow(this);"><img src="../../images/delete.gif"
border="0" WIDTH="51" HEIGHT="23"></td>
<td><input type=text name=textmin size=5 value=""></td>
<td><input type=text name=textmax size=5 value=""></td>
<td><input type=text name=textdecile size=5 value=""></td>
</tr>
</table>
<br>
<center><input type=button value=ok name=ok size=5
onclick=checkboxes()></center>
</form>
</body>
</html>

<script language=javascript>
function checkboxes()
{
///here the scripting should be done which sorts the table basing on
the values in 3rd column
}
</script>

Dec 21 '05 #1
2 1095
VK

ka*****@gmail.com wrote:
the table should be sorted basing on the values of the third column


Unless you're using a data bound table, table sorting is a rather
complicated task. For some inspitation ideas you may look at
<http://www.mattkruse.com/javascript/sorttable/>

Data bound table doesn't need scripting at all, but unfortunately it is
still IE-only.

Dec 21 '05 #2
VK wrote:
Unless you're using a data bound table, table sorting is a rather
complicated task. For some inspitation ideas you may look at
<http://www.mattkruse.com/javascript/sorttable/>


Actually, I recommend against it. I'm taking that lib down, as it was
written back in Netscape 4.x days when sorting tables was considerably more
complex. These days, there are better solutions...

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Dec 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1680
by: Kurt Watson | last post by:
I’m having a different kind of problem with Hotmail when I sign in it says, "Web Browser Software Limitations Your Current Software Will Limit Your Ability to Use Hotmail You are using a web...
7
3571
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
23
3232
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
0
926
by: Kurt Watson | last post by:
I’m having a different kind of problem with Hotmail when I sign in it says, "Web Browser Software Limitations Your Current Software Will Limit Your Ability to Use Hotmail You are using a web...
1
9587
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
0
7373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.