Hello,
I've got a script I'm trying to remove a required field from. One of my users has an old computer with a really old browser that's not displaying a drop down box. So what I'm going to try is to have that drop down box not be a required field.
$rid is what I need to remove from being a required field. Here's the code snippet I think my answer's in but I've tried several variations and no luck:
if($_SESSION['loggedin'] == "1")
{
if(($submit == "Post Work") && ((($rid == "") || ($title == "") || ($chapter == "") || ($summary == "")) || (($charid == "") && ($numchars != "0")) || (($gid == "") && ($numgenres != "0"))))
{
$submit = "Preview";
}
if($submit == "Preview")
{
if ((($storyfile == "") || ($storyfile == "none")) && ($storytext == ""))
{
$output .= "<center>"._NOSTORYTEXT."</center>";
}
else
{
if($charid != "")
{
$count = 0;
foreach ($charid as $character)
{
if($count != 0)
$charstring .= ", ";
$charstring = $charstring . $character;
$count++;
}
}
if($gid != "")
{
$count2 = 0;
foreach ($gid as $genre)
{
if($count2 != 0)
$genrestring .= ", ";
$genrestring = $genrestring . $genre;
$count2++;
}
}
if($wid != "")
{
$count3 = 0;
foreach ($wid as $warning)
{
if($count3 != 0)
$warningstring .= ", ";
$warningstring = $warningstring . $warning;
$count3++;
}
}
if((($rid == "") || ($title == "") || ($chapter == "") || ($summary == "")) || (($charid == "") && ($numchars != "0")) || (($gid == "") && ($numgenres != "0")))
{
$output .= "<font style=\"color:red\">"._MISSINGFIELDS."</font><br><br>";
}
if(($storyfile != "") && ($storyfile != "none"))
{
if (($_FILES['storyfile']['type'] != ('text/html')) && ($_FILES['storyfile']['type'] != ('text/plain')))
{
$output .= "<b>"._INVALIDUPLOAD."</b><br><br>";
}
else
{
$texts = file($storyfile);
foreach ($texts as $text) {
$story .= nl2br(stripslashes(strip_tags($text, '<b><i><u><center><img><a><hr><p>')));
}
}
}
else if($storytext != "")
{
$story = nl2br(stripslashes(strip_tags($storytext, '<b><i><u><center><img><a><hr><p>')));
}
$title = stripslashes($title);
$chapter = stripslashes($chapter);
$summary = stripslashes($summary);
$charstring = stripslashes($charstring);
$genrestring = stripslashes($genrestring);
$warningstring = stripslashes($warningstring);
$output .= $_FILES['storyfile']['type'];
$output .= ""._TITLE.": $title<br>
"._CHAPTERTITLE.": $chapter<br>
"._RATING.": $rid<br>
"._WARNINGS.": $warningstring<br>
"._SUMMARY.": $summary<br><br>";
$output .= "$story";
Help is greatly appreciated. Thanks.