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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP + Javascript.

Status
Not open for further replies.

LordGarfield

IS-IT--Management
Jul 31, 2003
112
BE
Hi all.

I wrote some code wich works fine but I want to do something a bit more. I shall post the code first.

<table width="100%">
<form name="test">
<?php
mysql_connect ('localhost', 'root', '');
mysql_select_db ('ghw');
$sql = "select * from color";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
{
echo "<tr><td><input type='checkbox' name='colors[]' value='" . $row['colorID'] . "'></td><td>" . $row['english'] . "</td><td><input type='text' name='colortxt[]'>€</td></tr>";
}
?>
</form>
</table>

What I'm doing here is to create a list with all colors available. you can check and uncheck a color and add a price for a color. But at this moment you can add a price on an unchecked color.

Is there a way (probably javascript) to do this:

-disable all text boxes.
-if checkbox is checked enably the corresponding textbox.
-check if they realy filled in an integer in the text box.

I think I need some help for this issue.

tanks.

tank you,

(>" "<)
(='o'=)
-(,,)-(,,)------------------------------
LORD_GARFIELD
---------------------------------------
 
Your best bet is to post this in the JavaScript forum, you have no problems getting the data (which would be a php thing) so it doesn't really belong here. Most of us could probabbly make a stab but for the best solution talk to the specialists
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top