I have the following code and I want to show some divs (to input IMEI or Serial Number) but just if the selected value is Phone or tablet (for imei) and if the elected value is Computer, Portable Drive, router etc etc how the Serial Number Div, i've tried this way but it keep saying this:
Notice: Undefined index: value in C:...\create.php on line 139
Notice: Undefined index: value in C:...\create.php on line 141
Line 139:$_POST['value'];
Line 141:switch($_POST['value']){
The main code: (I have more inputs, I'm just giving an exemple of what my comboBox looks like)
<select name="value">
<option value="Phone" <?php echo !empty($ativo) && $ativo == 'Phone' ?
'selected' : ''; ?>>Phone</option>
<option value="IPAD" <?php echo !empty($ativo) && $ativo == 'IPAD' ?
'selected' : ''; ?>>IPAD</option>
</select>
And the PHP code:
$_POST['value'];
switch($_POST['value'])
{
case 'Phone':
echo 'I have an IMEI';
break;
case 'Computer':
echo 'I have a Serial Number';
break;
case 'Bag':
echo 'Im just a bag';
break;
default:
// Something went wrong or form has been tampered.
}
Node: I just put "echo" to do an experiment just to see if it works but it keep saying the same!