473,385 Members | 2,243 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,385 software developers and data experts.

Ajax/PHP Help, missing something simple to call textbox...

1
Not sure what I am missing sure its probably something very simple, I need something to get my entered text out of the textbox and entered into a database currently the code looks like this.

[PHP]

for ($i=0; $i < mysql_num_fields($result); $i++) {
$st = sprintf("field: %s\n",mysql_field_name($result, $i));
//fputs($stderr, "$st\n");
if (mysql_field_name($result, $i) != "email") {
if (mysql_field_name($result, $i) == "first_names") {
$retval .= sprintf("<td bgcolor=%s><a href='mailto:%s' style='text-decoration: none;'><font class='status'>%s</font></a></td>",$color,$email,$row[$i] ? $row[$i] : '&nbsp;');
} elseif (mysql_field_name($result, $i) == "status") {
$retval .= sprintf("<td bgcolor=%s><input type=text id=textbox1 OnChange=\"UpdateStatus('%s','%s','textbox1.value' );\" value=\"%s\"></input></td>",$color,$row[0],$row[1],$row[$i] ? $row[$i] : '&nbsp;');
} elseif (mysql_field_name($result, $i) == "timestamp") {
$retval .= sprintf("<td bgcolor=%s>%s</input></td>",$color,$row[$i] ? $row[$i] : '&nbsp;');
} elseif (mysql_field_name($result, $i) == "day") {
$retval .= sprintf("<td bgcolor=%s>%s</input></td>",$color,$row[$i] ? $row[$i] : '&nbsp;');
} elseif (mysql_field_name($result, $i) == "date") {
$retval .= sprintf("<td bgcolor=%s>%s</input></td>",$color,$row[$i] ? $row[$i] : '&nbsp;');
} else {
$retval .= sprintf("<td bgcolor=%s><font class='status'>%s</a></td>",$color,$row[$i] ? $row[$i] : '&nbsp;');
}
}
}


[/PHP]

right now the output I currently get where I want to be the actual value of the textbox that is entered I am getting "textbox1.value" I also tried this.value and a few other ideas... anyone knoew waht I am missing?
Dec 28 '06 #1
1 1456
ronverdonk
4,258 Expert 4TB
Yes, you are filling a string with the value 'text1.value'. In order to get the text1 value you must pick it up in your UpdateStatus routine. E.g.
Expand|Select|Wrap|Line Numbers
  1. var txt = document.getElementById('text1').value 
Ronald :cool:
Dec 28 '06 #2

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

Similar topics

7
by: Peter Row | last post by:
Hi, I've started work on my own control some parts of which use standard controls, others I need to draw on my controls surface to get the display output I require, however.... I seem to be...
31
by: Tony | last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype.js" that is not well-liked...
4
by: Grant Merwitz | last post by:
Hi I am trying to implement the Microsoft Ajax.NET extensions to perform a lookup on a key press of a text box. What this will do is once a user enters a letter into the textbox, this will...
5
by: steve.chambers | last post by:
I'm sure this q must have been asked before but I'm really struggling to find the answer anywhere so have finally given up and will consult the usenet community - hopefully there's someone out...
7
by: MikeB | last post by:
Hello All, I am new to ajax and wanted to start by trying something simple. I have a web form with an updatepanel and then inside the update panel I have a listbox. Then outside of the updatepanel...
5
by: simon | last post by:
hello, I have a server set up on my local (home) network and can not get an ajax application to run on the box. it works fine on our developement server and also works fine locally. I...
3
by: Cirene | last post by:
I have a simple page - 2 dropdowns, 2 textboxes. 1 set of dropdown/textbox is in the updatepanel. 1 set of dropdown/textbox is not. When I select a dropdown the textbox is updated with teh...
4
by: Peter | last post by:
ASP.NET I have an application which use ASP.NET Autocomplete extender which works great. But I have a question how to update all the fields on the screen using Ajax. Users starts typing in a...
1
by: E11esar | last post by:
Hi there. I have created an asp.net page with C# and have added two tabs using the respective AJAX control. I am trying to add a table within an AJAX Accordion control in the second tab but I am...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...

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.