By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,932 Members | 1,511 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,932 IT Pros & Developers. It's quick & easy.

need help with client-side table behavior

P: n/a
PJ6
I have a table that changes its cell (input text) colors when their contents
have changed (actually on keypress) and shows a couple of buttons
automatically, UDPATE and CANCEL. This works partially, though detecting
enter and escape doesn't seem to work, or parhaps calling the button click
events directly doesn't (see below).

In addition to getting the ENTER and ESC keypresses to fire their
appropriate button clicks, I need to be able to collect information on which
cells have changed, so on the page loading again I can read this
information, perhaps from a hidden field, to use to update a database
server-side.

What would be the best way to do this?

Thanks in advance for any help,
Paul

<script language=javascript>
function GirdTextKeyPress(txtID, btnsContainerlID, btnUpdateID, btnCancelID)
{
var txt = document.getElementById(txtID);
txt.className = 'GridChanged';
var bc = document.getElementById(btnsContainerlID);
bc.style.display = 'inline';

var btnUpdate = document.getElementById(btnsContainerlID);
if (event.keyCode == 13)
{
event.returnValue=false;
event.cancelBubble = true;
btnUpdate.click();
}

var btnCancel = document.getElementById(btnCancelID)
if (event.keyCode == 61)
{
event.returnValue=false;
event.cancelBubble = true;
btnCancel.click();
}
}
</script>

<style>
Input.Grid
{
border-style:none;
}
Input.GridChanged
{
background-Color:Yellow
}
</style>
Nov 30 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
PJ6
Never mind, I sorted it all out.

Paul

"PJ6" <no****@nowhere.net> wrote in message
news:ZHjjf.165$n84.138@trnddc06...
I have a table that changes its cell (input text) colors when their
contents have changed (actually on keypress) and shows a couple of buttons
automatically, UDPATE and CANCEL. This works partially, though detecting
enter and escape doesn't seem to work, or parhaps calling the button click
events directly doesn't (see below).

In addition to getting the ENTER and ESC keypresses to fire their
appropriate button clicks, I need to be able to collect information on
which cells have changed, so on the page loading again I can read this
information, perhaps from a hidden field, to use to update a database
server-side.

What would be the best way to do this?

Thanks in advance for any help,
Paul

<script language=javascript>
function GirdTextKeyPress(txtID, btnsContainerlID, btnUpdateID,
btnCancelID)
{
var txt = document.getElementById(txtID);
txt.className = 'GridChanged';
var bc = document.getElementById(btnsContainerlID);
bc.style.display = 'inline';

var btnUpdate = document.getElementById(btnsContainerlID);
if (event.keyCode == 13)
{
event.returnValue=false;
event.cancelBubble = true;
btnUpdate.click();
}

var btnCancel = document.getElementById(btnCancelID)
if (event.keyCode == 61)
{
event.returnValue=false;
event.cancelBubble = true;
btnCancel.click();
}
}
</script>

<style>
Input.Grid
{
border-style:none;
}
Input.GridChanged
{
background-Color:Yellow
}
</style>

Nov 30 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.