Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Guessing this might be an HTML & javascript issue so I'll start here

Status
Not open for further replies.

BobMCT

IS-IT--Management
Sep 11, 2000
756
US
I'm trying to maintain someone else's program and of course things are done differently that I'm used to.
I've played with this for many days without success so I thought I would post here.

I have a web page with a <form and that form contains a table where each column is defined as "contenteditable=yes".
I'm trying to embed a javascript color picker (jscolor.js) into this field which I have working but the field update does not work.
Below is an html snippet for this column:

<td id="contact_color:<?=$status_id?>" contenteditable="true">
<input class="jscolor { closable:true,closeText:'Select!' }" value="<?=$contact_color?>" data-id="contact_color:<?=$status_id?>" />
</td>

and here is the javascript function that supposedly updates this:
<script>
// *****************************************************************
// acknowledgement message
$(function() {
var message_status = $("#status");
$("td[contenteditable=true]").blur(function(){
var field_userid = $(this).attr("id");
var value = $(this).text();
$.post('category-admin-update.php',field_userid + "=" + value,
function(data) {
if (data != '') {
message_status.show();
message_status.text(data);
//hide the message
setTimeout(function(){message_status.hide()},15000);
}
});
});
});
// *****************************************************************
</script>

Also be aware that I am not a good js person. I dabble a little or use public scripts.

So, any help, guidance, ideas, suggestions greatly appreciated.

Thanks [ponder]
 
the contenteditable attribute is an enumerated value NOT a Boolean so "yes" does not equate to True.



Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top