banklifemarketing Posted October 13, 2011 Share Posted October 13, 2011 Hello Please help if you can in this advanced form box i would like to not have to chose the produce or the genre in order to search. the way it is set up now if i dont selct a producer and a genre it wont let me search. I would like to have a choice not to select one or the other or both if need be. the page is http://beats4real.com/advsearch.php the advsearch.php code is: <?php require THEMES_INCLUDES."overall.header.php";?> <link rel="stylesheet" type="text/css" href="css/form.css" /> <script type="text/javascript" src="js/search.js"></script> <script type="text/javascript"> function thisMovie(movieName) { if(navigator.appName.indexOf("Microsoft") != -1) { return window[movieName]; } else { return document[movieName]; } }; function loadNewFile(mainAudio, overAudio, audioName, buyLink) { var currName = thisMovie("player"); currName.loadNewSet(mainAudio, overAudio, audioName, buyLink); } </script> <table width="960" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="210" align="left" valign="top"><?php require THEMES_INCLUDES."overall.left.php";?></td> <td width="540" align="center" valign="top"><table width="520" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top" class="headimg_text" style="padding-left:5px;">Advance Search</td> </tr> <tr> <td align="left" valign="top"> </td> </tr> <tr> <td align="center" valign="top"><table width="520" border="0" cellpadding="0" cellspacing="0" class="cbox_bg" align="center"> <tr> <td align="justify" valign="top" style="padding:5px;"> </td> </tr> <form action="" method="get" name="form" id="form" onsubmit="return validate(this)"> <tr> <td align="center" valign="top" style="padding:5px;"><table width="90%" border="0" cellspacing="0" cellpadding="4" align="center"> <tr> <td width="26%" align="left" valign="middle" class="text_font"><span class="errfont">* </span>Producer</td> <td width="2%" align="left" valign="middle" class="text_font">:</td> <td width="72%" align="left" valign="middle"> <select name="pid" class="medium_input_text" id="pid"> <option value="">Select</option> <?php $producers=Beats::getAllProducers(); if(count($producers)>0): foreach($producers as $k=>$mod): ?> <option value="<?php echo $mod['id'] ?>"><?php echo $mod['name'] ?></option> <?php endforeach; endif; ?> </select> </td> </tr> <tr> <td align="left" valign="middle" class="text_font"><span class="errfont">*</span> Genre</td> <td align="left" valign="middle" class="text_font">:</td> <td align="left" valign="middle"> <select name="gid" class="medium_input_text" id="gid"> <option value="">Select</option> <?php $gdatas=Beats::getAllGenres(); if(count($gdatas)>0): foreach($gdatas as $k=>$gdata): ?> <option value="<?php echo $gdata['id'] ?>"><?php echo $gdata['name'] ?></option> <?php endforeach; endif; ?> </select> </td> </tr> <tr> <td align="left" valign="middle" class="text_font"> <span class="errfont"> </span> Beat</td> <td align="left" valign="middle" class="text_font">:</td> <td align="left" valign="middle"> <input type="text" name="beat" class="medium_input_text" > </td> </tr> <tr> <td align="center" valign="middle" colspan="3" style="padding-top:10px;"><input type="submit" name="advsearch" value="Search" class="button"></td> </tr> </table> </td> </tr> </form> <tr> <td align="justify" valign="top" style="padding:5px;"> </td> </tr> </table> </td> </tr> <tr> <td align="justify" valign="top" style="padding:5px;"> </td> </tr> <?php //if(isset($gets['advsearch'])):?> <?php if(count($searchresults)>0): ?> <tr> <td align="left" valign="top" class="headimg_text" style="padding-left:5px;">Advance Search Result</td> </tr> <tr> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"><table width="520" border="0" cellpadding="0" cellspacing="0" class="box_bg"> <tr> <td align="center" valign="middle" style="padding-top:10px;"> <?php if(isset($gets['fileid'])){ $id=$gets['fileid']; $beatfile=Beats::getDetail($id); } ?> <span style="padding:10px;"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="500" height="50" id="player" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="flashVars" value="colorCode=0x<?php echo $cssplayer['button_color'];?>" /> <param name="movie" value="player/player.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#<?php echo $cssplayer['box_bg_color'];?>" /> <embed src="player/player.swf" quality="high" bgcolor="#<?php echo $cssplayer['box_bg_color'];?>" width="500" height="50" flashVars="colorCode=0x<?php echo $cssplayer['button_color'];?>" name="player" align="middle" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed> </embed> </object> </span></td> </tr> </table></td> </tr> <tr> <td align="left" valign="top"> </td> </tr> <tr> <td align="center" valign="top"><table width="520" border="0" cellpadding="0" cellspacing="0" class="" align="center"> <tr> <td align="center" valign="top" style="padding:5px;"><table width="520" border="0" cellpadding="0" cellspacing="0" class="details_box_head"> <tr> <td height="34" align="center" valign="middle"><table width="520" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="110" align="center" valign="middle">TITLE</td> <td width="100" align="center" valign="middle" >GENRE</td> <td width="100" align="center" valign="middle">PRODUCER</td> <td width="58" align="center" valign="middle">PRICE</td> <td width="69" align="center" valign="middle">LICENSE</td> <td width="40" align="center" valign="middle">PLAY</td> <td width="110" align="center" valign="middle"><?php echo DL_LABEL; ?></td> </tr> </table></td> </tr> <tr> <td height="20" align="center" valign="top"><table width="512" border="0" cellpadding="0" cellspacing="0" class="details_box_bg"> <tr> <td align="center" valign="top"><table width="512" border="0" cellspacing="0" cellpadding="0"> <?php $count=0; ?> <?php foreach($searchresults as $k=>$beat):?> <?php $producer=Beats::getProducerDetail($beat['producer_id']); ?> <?php $genres=Beats::getGenreDetail($beat['genres_id']); ?> <tr> <td width="70" align="center" valign="middle" class="line_border2" id="slidingProduct<?php echo $beat['id']; ?>"><div class="sliding_product"> <div title="<?php echo $beat['title'];?>" style="overflow:hidden;width:70px;white-space: <?php echo $cssplayer['css_1'];?>; text-overflow: ellipsis"><?php echo $beat['title'];?></div> </div></td> <td width="67" align="center" valign="middle" class="line_border1"><div title="<?php echo $genres['name'];?>" style="overflow:hidden;width:67px"><?php echo $genres['name'];?></div></td> <td width="67" align="center" valign="middle" class="line_border1"><div title="<?php echo $producer['name'];?>" style="overflow:hidden;width:67px"><a class=""href="<?php echo $producer['name'];?>"><?php echo $producer['name'];?></a></div></td> <td width="45" align="center" valign="middle" class="line_border1"><?php echo C_SYMBOL.''.$beat['price'];?></td> <td width="50" align="center" valign="middle" class="line_border1"><?php echo $beat['license'];?></td> <td width="25" align="center" valign="middle" class="line_border1"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="20" height="20" id="smallPlayer2" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="flashVars" value="mainAudio=<?php echo "audio-".$beat['id'];?>&overAudio=voice/<?php echo $cssplayer['voice_tag'];?>&colorCode=0x<?php echo $cssplayer['button_color_b'];?>&audioName=<?php echo $producer['name'];?> - <?php echo $beat['title'];?> - <?php echo C_SYMBOL.''.$beat['price'];?> - <?php echo $genres['name'];?>" /> <param name="movie" value="player/smallPlayer.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#<?php echo $cssplayer['details_box_bg'];?>" /> <embed src="player/smallPlayer.swf" quality="high" bgcolor="#<?php echo $cssplayer['details_box_bg'];?>" width="20" height="20" flashVars="mainAudio=<?php echo "audio-".$beat['id'];?>&overAudio=voice/<?php echo $cssplayer['voice_tag'];?>&colorCode=0x<?php echo $cssplayer['button_color_b'];?>&audioName=<?php echo $producer['name'];?> - <?php echo $beat['title'];?> - <?php echo C_SYMBOL.''.$beat['price'];?> - <?php echo $genres['name'];?>" name="smallPlayer002" align="middle" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed> </embed> </embed> </object> </a></td> <?php if($flag_download == 'true'){?> <td width="60" class="download"><a href="download.php?id=<?=$order_id?>&b_file=<?=$beat['beat_file']?>"><?php echo DL_LABEL; ?> </a></td> <?php } else { ?> <td width="57" align="center" valign="middle" class="line_border"><a class="download" href="#" onclick="addToBasket(<?php echo $beat['id']; ?>);return false;"><?php echo DL_LABEL; ?></a></td> <?php } ?> </tr> <?php $count=$k+1;?> <?php endforeach; ?> </table></td> </tr> <?php if($allnewestbeat>$count): ?> <?php endif; ?> </table></td> </tr> </table></td> </tr> <tr> <td align="center" valign="top" style="padding-top:10px;" class="next"><?php echo $searchresultPaging; ?></td> </tr> <tr> <td align="center" valign="top" style="padding:5px;"> </td> </tr> </table></td> </tr> <?php elseif(isset($searchresults)): ?> <tr> <td align="center" valign="top"><table width="520" border="0" cellpadding="0" cellspacing="0" class="box_bg" align="center"> <tr> <td align="center" valign="top" style="padding:5px;">No Result Found.</td> </tr> </table></td> </tr> <?php //endif;?> <?php endif;?> <tr> <td align="left" valign="top"> </td> </tr> </table></td> <td width="210" align="left" valign="top"><?php require THEMES_INCLUDES."overall.right.php";?></td> </tr> </table> <?php require THEMES_INCLUDES."overall.footer.php";?> Quote Link to comment https://forums.phpfreaks.com/topic/249015-removing-mandatory-anserr-from-form/ Share on other sites More sharing options...
codefossa Posted October 13, 2011 Share Posted October 13, 2011 Code box. >_< <?php require THEMES_INCLUDES . "overall.header.php"; ?> <link rel="stylesheet" type="text/css" href="css/form.css" /> <script type="text/javascript" src="js/search.js"></script> <script type="text/javascript"> function thisMovie(movieName) { if(navigator.appName.indexOf("Microsoft") != -1) { return window[movieName]; } else { return document[movieName]; } }; function loadNewFile(mainAudio, overAudio, audioName, buyLink) { var currName = thisMovie("player"); currName.loadNewSet(mainAudio, overAudio, audioName, buyLink); } </script> <table width="960" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="210" align="left" valign="top"><?php require THEMES_INCLUDES . "overall.left.php"; ?></td> <td width="540" align="center" valign="top"><table width="520" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top" class="headimg_text" style="padding-left:5px;">Advance Search</td> </tr> <tr> <td align="left" valign="top"> </td> </tr> <tr> <td align="center" valign="top"><table width="520" border="0" cellpadding="0" cellspacing="0" class="cbox_bg" align="center"> <tr> <td align="justify" valign="top" style="padding:5px;"> </td> </tr> <form action="" method="get" name="form" id="form" onsubmit="return validate(this)"> <tr> <td align="center" valign="top" style="padding:5px;"><table width="90%" border="0" cellspacing="0" cellpadding="4" align="center"> <tr> <td width="26%" align="left" valign="middle" class="text_font"><span class="errfont">* </span>Producer</td> <td width="2%" align="left" valign="middle" class="text_font">:</td> <td width="72%" align="left" valign="middle"> <select name="pid" class="medium_input_text" id="pid"> <option value="">Select</option> <?php $producers = Beats::getAllProducers(); if (count($producers) > 0): foreach ($producers as $k => $mod): ?> <option value="<?php echo $mod['id'] ?>"><?php echo $mod['name'] ?></option> <?php endforeach; endif; ?> </select> </td> </tr> <tr> <td align="left" valign="middle" class="text_font"><span class="errfont">*</span> Genre</td> <td align="left" valign="middle" class="text_font">:</td> <td align="left" valign="middle"> <select name="gid" class="medium_input_text" id="gid"> <option value="">Select</option> <?php $gdatas = Beats::getAllGenres(); if (count($gdatas) > 0): foreach ($gdatas as $k => $gdata): ?> <option value="<?php echo $gdata['id'] ?>"><?php echo $gdata['name'] ?></option> <?php endforeach; endif; ?> </select> </td> </tr> <tr> <td align="left" valign="middle" class="text_font"> <span class="errfont"> </span> Beat</td> <td align="left" valign="middle" class="text_font">:</td> <td align="left" valign="middle"> <input type="text" name="beat" class="medium_input_text" > </td> </tr> <tr> <td align="center" valign="middle" colspan="3" style="padding-top:10px;"><input type="submit" name="advsearch" value="Search" class="button"></td> </tr> </table> </td> </tr> </form> <tr> <td align="justify" valign="top" style="padding:5px;"> </td> </tr> </table> </td> </tr> <tr> <td align="justify" valign="top" style="padding:5px;"> </td> </tr> <?php //if(isset($gets['advsearch'])): ?> <?php if (count($searchresults) > 0): ?> <tr> <td align="left" valign="top" class="headimg_text" style="padding-left:5px;">Advance Search Result</td> </tr> <tr> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top"><table width="520" border="0" cellpadding="0" cellspacing="0" class="box_bg"> <tr> <td align="center" valign="middle" style="padding-top:10px;"> <?php if (isset($gets['fileid'])) { $id = $gets['fileid']; $beatfile = Beats::getDetail($id); } ?> <span style="padding:10px;"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="500" height="50" id="player" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="flashVars" value="colorCode=0x<?php echo $cssplayer['button_color']; ?>" /> <param name="movie" value="player/player.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#<?php echo $cssplayer['box_bg_color']; ?>" /> <embed src="player/player.swf" quality="high" bgcolor="#<?php echo $cssplayer['box_bg_color']; ?>" width="500" height="50" flashVars="colorCode=0x<?php echo $cssplayer['button_color']; ?>" name="player" align="middle" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed> </embed> </object> </span></td> </tr> </table></td> </tr> <tr> <td align="left" valign="top"> </td> </tr> <tr> <td align="center" valign="top"><table width="520" border="0" cellpadding="0" cellspacing="0" class="" align="center"> <tr> <td align="center" valign="top" style="padding:5px;"><table width="520" border="0" cellpadding="0" cellspacing="0" class="details_box_head"> <tr> <td height="34" align="center" valign="middle"><table width="520" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="110" align="center" valign="middle">TITLE</td> <td width="100" align="center" valign="middle" >GENRE</td> <td width="100" align="center" valign="middle">PRODUCER</td> <td width="58" align="center" valign="middle">PRICE</td> <td width="69" align="center" valign="middle">LICENSE</td> <td width="40" align="center" valign="middle">PLAY</td> <td width="110" align="center" valign="middle"><?php echo DL_LABEL; ?></td> </tr> </table></td> </tr> <tr> <td height="20" align="center" valign="top"><table width="512" border="0" cellpadding="0" cellspacing="0" class="details_box_bg"> <tr> <td align="center" valign="top"><table width="512" border="0" cellspacing="0" cellpadding="0"> <?php $count = 0; ?> <?php foreach ($searchresults as $k => $beat): ?> <?php $producer = Beats::getProducerDetail($beat['producer_id']); ?> <?php $genres = Beats::getGenreDetail($beat['genres_id']); ?> <tr> <td width="70" align="center" valign="middle" class="line_border2" id="slidingProduct<?php echo $beat['id']; ?>"><div class="sliding_product"> <div title="<?php echo $beat['title']; ?>" style="overflow:hidden;width:70px;white-space: <?php echo $cssplayer['css_1']; ?>; text-overflow: ellipsis"><?php echo $beat['title']; ?></div> </div></td> <td width="67" align="center" valign="middle" class="line_border1"><div title="<?php echo $genres['name']; ?>" style="overflow:hidden;width:67px"><?php echo $genres['name']; ?></div></td> <td width="67" align="center" valign="middle" class="line_border1"><div title="<?php echo $producer['name']; ?>" style="overflow:hidden;width:67px"><a class=""href="<?php echo $producer['name']; ?>"><?php echo $producer['name']; ?></a></div></td> <td width="45" align="center" valign="middle" class="line_border1"><?php echo C_SYMBOL . '' . $beat['price']; ?></td> <td width="50" align="center" valign="middle" class="line_border1"><?php echo $beat['license']; ?></td> <td width="25" align="center" valign="middle" class="line_border1"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="20" height="20" id="smallPlayer2" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="flashVars" value="mainAudio=<?php echo "audio-" . $beat['id']; ?>&overAudio=voice/<?php echo $cssplayer['voice_tag']; ?>&colorCode=0x<?php echo $cssplayer['button_color_b']; ?>&audioName=<?php echo $producer['name']; ?> - <?php echo $beat['title']; ?> - <?php echo C_SYMBOL . '' . $beat['price']; ?> - <?php echo $genres['name']; ?>" /> <param name="movie" value="player/smallPlayer.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#<?php echo $cssplayer['details_box_bg']; ?>" /> <embed src="player/smallPlayer.swf" quality="high" bgcolor="#<?php echo $cssplayer['details_box_bg']; ?>" width="20" height="20" flashVars="mainAudio=<?php echo "audio-" . $beat['id']; ?>&overAudio=voice/<?php echo $cssplayer['voice_tag']; ?>&colorCode=0x<?php echo $cssplayer['button_color_b']; ?>&audioName=<?php echo $producer['name']; ?> - <?php echo $beat['title']; ?> - <?php echo C_SYMBOL . '' . $beat['price']; ?> - <?php echo $genres['name']; ?>" name="smallPlayer002" align="middle" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed> </embed> </embed> </object> </a></td> <?php if ($flag_download == 'true') { ?> <td width="60" class="download"><a href="download.php?id=<?= $order_id ?>&b_file=<?= $beat['beat_file'] ?>"><?php echo DL_LABEL; ?> </a></td> <?php } else { ?> <td width="57" align="center" valign="middle" class="line_border"><a class="download" href="#" onclick="addToBasket(<?php echo $beat['id']; ?>);return false;"><?php echo DL_LABEL; ?></a></td> <?php } ?> </tr> <?php $count = $k + 1; ?> <?php endforeach; ?> </table></td> </tr> <?php if ($allnewestbeat > $count): ?> <?php endif; ?> </table></td> </tr> </table></td> </tr> <tr> <td align="center" valign="top" style="padding-top:10px;" class="next"><?php echo $searchresultPaging; ?></td> </tr> <tr> <td align="center" valign="top" style="padding:5px;"> </td> </tr> </table></td> </tr> <?php elseif (isset($searchresults)): ?> <tr> <td align="center" valign="top"><table width="520" border="0" cellpadding="0" cellspacing="0" class="box_bg" align="center"> <tr> <td align="center" valign="top" style="padding:5px;">No Result Found.</td> </tr> </table></td> </tr> <?php //endif; ?> <?php endif; ?> <tr> <td align="left" valign="top"> </td> </tr> </table></td> <td width="210" align="left" valign="top"><?php require THEMES_INCLUDES . "overall.right.php"; ?></td> </tr> </table> <?php require THEMES_INCLUDES . "overall.footer.php"; ?>] Quote Link to comment https://forums.phpfreaks.com/topic/249015-removing-mandatory-anserr-from-form/#findComment-1278867 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.