Hi all, I need some help
I am very new with the PHP and HTML, I tried to edit this message so it will be readable
I have this HTML Code:
<html>
<head>
<title>create orders</title>
<script>
function enable()
{
document.myForm.textbox.disabled = false;
}
</script>
</head>
<body>
<div align="left">
<form action="create_orders.php" method="post">
<p dir="ltr" style="MARGIN-RIGHT: 0px" align="left"> </p>
<p dir="ltr" style="MARGIN-RIGHT: 0px" align="left">
item: <input name="item" <br><br>
quantity: <input name="quantity"><br>
sapak: <input name="sapak"><br>
<input type="submit" value="Submit Query"> </p>
</form>
<form name="myForm">
<input type="checkbox" onclick="enable()"> enable to link for another order<br><br>
<input type="text" name="textbox" value="enter order num" disabled>
</form>
</div>
how can I do an if statement that will check if the checkbox enable or not, if yes I want the value that the user enter will enter to a variable and I will call a function from my DB.
I hope my message is clear enough
Thanks a lot
help with html + PHP if statement
Moderator: General Moderators
-
newwithphp
- Forum Newbie
- Posts: 2
- Joined: Thu Aug 14, 2008 4:47 am
Re: help with html + PHP if statement
first give a name to the check box say name="chkbox"
in the php code write this
in the php code write this
Code: Select all
$chkbox= $_POST['chkbox'];
if($chkbox==on)
{
//your code goes here..
}