LordGarfield
IS-IT--Management
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
---------------------------------------
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
---------------------------------------