473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

change content of the table

76
hi,
is there any way i could click on the html table content (<td>) and edit the info, and then click a button to update the modification into a database?
i found the following function off the internet, and it really doesn't do the thing that mentioned above, but just replaces the content with the specified "WORD".

Expand|Select|Wrap|Line Numbers
  1. function changeContent(){
  2.     var x=document.getElementById('myTable').rows
  3.     var y=x[0].cells
  4.     y[0].innerHTML="NEW CONTENT"
  5. }
  6.  
please help. thanks a lot in advance.
Feb 23 '08 #1
3 1843
dlite922
1,584 Expert 1GB
why don't you put the contents of the <td> into a text field

[PHP]
<td><input type="text" name="nameGoesHere" value="Value Here" /></td>

[/PHP]

You don't like the looks of it you say? want it to look like regular text?

You can completely change the look of an input tag with css.

background color, no border would do the trick for you.

" Google input html css "
Feb 24 '08 #2
idorjee
76
hi dlite922,
thanks for your reply. i tried that already and doesn't work. here is what i'm actually doing:
the script gets the $desc (string) from somewhere, and
Expand|Select|Wrap|Line Numbers
  1. echo "<TR bgcolor=\"#660000\"><TD COLSPAN=2><input type=\"text\" name=\"desc\" value=\"$desc\" /></TD></TR>";
  2.  
the next thing that i'm trying to do is to submit the $desc variable, AFTER making some changes to it, to another script that would insert it into the database:
Expand|Select|Wrap|Line Numbers
  1. echo "<form name=\"go\" method=\"post\" action=\"ezadd.php\">";
  2. echo "<input type=\"hidden\" name=\"desc\" value=\"$desc\">";
  3. echo "<input type=\"submit\" name=\"submit\" value=\"Add to DB\">";
  4.  
Thank you!
Feb 24 '08 #3
acoder
16,027 Expert Mod 8TB
the next thing that i'm trying to do is to submit the $desc variable, AFTER making some changes to it, to another script that would insert it into the database:
Without refreshing the page?
Feb 25 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Csaba2000 | last post by:
How do I detect when the font size has been changed (especially by user action: either Ctrl+Scroll wheel or View/Text Size)? This is just for use on IE 5.5+, but it would be great if there was a...
14
by: Reply Via Newsgroup | last post by:
Folks, Say I have a table, ten columns, ten rows - Each with a word in it. I want to change the values of some/all of the cells in the table via a hyperlink. How do I reference each cell and...
3
by: Byron | last post by:
Hi, Javascript confuses me, so I usually limit myself to Dreamweaver's built-in scripts for stuff like imageswaps. But this time I'm trying to write something very simple myself. I do most of my...
11
by: SarahMarsden | last post by:
I'm new to Dreamweaver (using MX 2004). I have a 2 row 3 column table. I have set each column to 200 pixels. The second row I have merged into one cell. When I enter text (or anything else) into...
1
by: Leo | last post by:
I created a user control which is some text contained in a HtmlTable. I put this control into main form. I would like to have the ability to move this control around in the main form. I think one...
7
by: Don NJ | last post by:
First my site name is Sinfullblisslingerie.com. I'm starting this little business to try and make some money on the side. My kids will be going to college in a few years... Anyway, in the past...
3
by: helraizer1 | last post by:
I have this code in JS function show_player() { document.mediaplayer1.style.visibility = "visible"; } function content(p, clip) { var mus = document.getElementById('music'); ...
6
by: gavy7210 | last post by:
hello i am using struts 1.2,Eclipse Platform Version: 3.4.2,mySql 5.0.1,jdk 1.5.. i have a login form(jsp) in which a user logs in,in case he doesnt enter his username and/or password an error...
5
by: thatcollegeguy | last post by:
Below are my 3php and 2js files. I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.