I am currently creating an html form on a web page, and i was wondering if there was a way to add default values to the text boxes, but the user could also just delete the default text and enter in new text if he needed to???
What i currently have is this...
<html>
<body>
<form method="post">
Suspend: <input type="text" name="sus"><br />
Device Name: <input type="text" name="dev"><br />
IP: <input type="text" name="ip"><br />
Dependency: <input type="text" value="none" name="depend"><br />
Email: <input type="email" value="abc@123.com" name="email">
<input type="submit" value="submit" name="submit">
</form>
</body>
</html>
<?php
if(isset($_POST['sumbit']))
{
$sus=$_POST['sus'];
$dev=$_POST['dev'];
$ip=$_POST['ip'];
$depend=$_POST['depend'];
$email=$_POST['email'];
if(isset($sus) && isset($dev) && isset($ip) && isset($depend) && isset($email)
{
$update=mysqli_query($con, "UPDATE table SET Suspend=$sus, Device=$dev, IP=$ip, Dependence=$depend, Email=$email WHERE id=$id");
}
}
With the email and dependency fields, they will be the default values 95% of the time, but not all the time, and my boss wants default values supplied for them, but also wants them to be able to change them... I then perform mysql queries with these $_POST results to update the database... right now, even if you change the text in the field in the form, it still enters in the default values in the database.. i need it to where if they do not change the default value, then the default value will be added to the database... any help would be greatly appreciated