473,796 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

change content of the table

76 New Member
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 1865
dlite922
1,584 Recognized Expert Top Contributor
why don't you put the contents of the <td> into a text field

[PHP]
<td><input type="text" name="nameGoesH ere" 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 New Member
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 Recognized Expert Moderator MVP
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
9564
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 generic solution. Thanks, Csaba Gabor from New York
14
2522
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 change its text contents from a link elsewhere in the page? I have a rought idea that I'll need something like 'id' in my <td> tags but while I have a greater understanding of server-side programming langauges like PHP, javascript is still very new...
3
5888
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 stuff in ASP and PHP so I'm familiar with server-side programming; for some reason JavaScript syntax trips me up. I want to assign a value to a variable according to an onclick event, and then run an if...then on the variable, and according to...
11
9487
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 the merged cell the 3 columns above change pixel width. The pixel width still says 200. But the pixel width shown in green above the columns it says 200(172)for example. It seems that the bracketed number is the size the cell displays at rather...
1
4764
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 way to do this is to change the style of this control at runtime ("Left:xx px; Top:xx px"). Another way is to move the HtmlTable in the control (i.e. change the style of it). However I couldn't figure out how to let it work. At design time, I...
7
2578
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 I have had some experience with html but now, my new site runs on php. It's a turnkey site that I purchased on ebay...(Yeah right...turnkey...) I've been submitting my site to search engines. On excite.com, when I bring up my site it shows...
3
3146
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'); mus.style.visibility = "visible";
6
4526
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 is displayed using the <ul> tag and <html:errors> in the jsp. in the from class a vaidate method creates an actionerrors object adds all the errors to it and finally returns it. the ids are linked in messageresources.properties and appropriate...
5
4468
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 if I have the entirely wrong approach, but my code is below. Any or all help is appreciated! What currently happens is that the getdivision.php script works perfectly and gives me an entire table of correct data. The problem is that when I click...
0
10449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10168
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9047
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5440
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2924
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.