Jump to content

Search the Community

Showing results for tags 'drop down'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 8 results

  1. We've got a responsive menu that when you click on an li the ul inside it is then displayed as a block (displayed as none beforehand). However you cannot then close the ul without refreshing the page or closing the menu itself. What we want is for when you click the li again, the ul inside it then displays as none. Is this possible using only CSS? (No jQuery please!!!) Any help is greatly appreciated, thanks!
  2. Hi everyone, I'm a complete newbie here. I've looked around for help and tried a few solutions without success, so because time is short I'm asking for help. I have a registration form which includes address details. The form holds a country field which is a listbox, the values being selected from a MySQL table. How do I assign the selected country option to a field list in the insert statement? Here's what I have so far: Registration page form: <div class="form-group"> <input type="text" class="form-control" id="country" name="country" placeholder="Country"> <select name="country_list"> <?php $sql = mysql_query("SELECT country_name FROM countries"); while ($row = mysql_fetch_array($sql)){ echo "<option value=\"country_list\">" . $row['country_name'] . "</option>"; } ?> </select> </div> The insert function page: switch ($action) { case 'signup': switch ($action) { case 'signup': $country = clean($_POST['$selectedOption']); etc. The insert statement: $sql_insert = "INSERT INTO user_mst(country) VALUES('$country_name)"; $result_insert = mysql_query($sql_insert) or die(mysql_error()); $id = mysql_insert_id($conn); In the code sections above, I've removed some of the other fields etc. to focus on the one bit I don't know howto fix. Thanks in advance for any help.
  3. Hey guys! Fairly new with PHP/MySQL and been working on a website for a class, and having some issues with my drop down not working as intended. What I'm trying to do is simply allow the user to select a name from a drop down field, then after pressing the submit button, would delete the selected name from the database. Here is my code. <?php ini_set('display_errors', 'on'); error_reporting(E_ALL); session_start(); $_SESSION['title'] = "PEC Menu"; //Opening Session Vars $currentFile = $_SERVER["PHP_SELF"]; //current page for menu $currentUser = $_SESSION['currentname']; // users account info include('../../functions/mainmenu.php'); // menu functions //Menu Content,Code / Buttons Goes here DrawMenu($currentFile, $currentUser); //Setting up database mysql_connect("localhost","root","changeme"); mysql_select_db("certestdb"); $dbLink = mysql_connect("localhost", "root", "changeme"); mysql_query("SET character_set_client=utf8", $dbLink); mysql_query("SET character_set_connection=utf8", $dbLink); $result = mysql_query("SELECT distinct TermID FROM clinical") or die(mysql_error()); $result2 = mysql_query("SELECT FullName FROM useraccess") or die(mysql_error()); $options=''; $options2=''; while($row=mysql_fetch_array($result)) { if (isset($_POST)) { $TermID=$row["TermID"]; $options.= '<option value="'.$row['TermID'].'">'.$row['TermID'].'</option>'; } }; while($row=mysql_fetch_array($result2)) { if (isset($_POST)) { $FullName=$row["FullName"]; $options2.= '<option value="'.$row['FullName'].'">'.$row['FullName'].'</option>'; } }; if (isset($_POST)) { mysql_query("DELETE FROM useraccess WHERE FullName='$FullName'") or die(mysql_error()); echo "Success!"; } else { echo "Not successful"; } ?> <html> <style> </style> <body> <h4> Add User</h4> <form name = "AddUser" action="PEC_addUser.php" method= "get" style = "text-align:right; color: Black;float:left;"> <input type="submit" value="Add User"> </form><br><br> <hr size = "5" color = "darkgray"> <h4> Assign User to Course</h4> <form name = "AssignUser" action=" " method= "get" style = "text-align:right; float:left; color: darkred;"> User: <select> </select> Course: <select> </select> Term: <SELECT NAME= termid> <OPTION VALUE=0>Choose</OPTION> <?php echo $options; ?> </select> <input type="submit" value="Assign"> </form> <br><br> <hr size = "5" color = "darkgray"> <h4> Assign Student to Instructor </h4> <form name = "AssignStudent" action=" " method= "get" style = "text-align:right; color: darkred;float:left;"> Student: <select> <option value = "Select"> Select</option>} <option value = "one"> 1</option>} <option value = "two"> 2</option>} <option value = "three"> 3</option>} </select> Course: <select> <option value = "Select"> Select</option>} <option value = "one"> 1</option>} <option value = "two"> 2</option>} <option value = "three"> 3</option>} </select> Instructor: <select> <option value = "Select"> Select</option>} <option value = "one"> 1</option>} <option value = "two"> 2</option>} <option value = "three"> 3</option>} </select> <input type="submit" value="Assign"> </form><br><br> <hr size = "5" color = "darkgray"> <h4> Delete User</h4> <form name = "DeleteUser" action=" " method= "get" style = "text-align:right; color: darkred;float:left;"> User: <SELECT NAME= FullName> <OPTION VALUE=0>Choose</OPTION> <?php echo $options2; ?> </select> <input type="submit" name="delete" value="delete"> </form><br><br> <hr size = "5" color = "darkgray"> <link rel="stylesheet" href="styles/pecui.css" media="screen" /> </body> </html> <?php ?> This is where the possible issue is if (isset($_POST)) { mysql_query("DELETE FROM useraccess WHERE FullName='$FullName'") or die(mysql_error()); echo "Success!"; } else { echo "Not successful"; } What happens is upon submitting, it just deletes the last 2 records in the table "useraccess" instead of the value selected from the drop down. I'm thinking that its not properly storing the data from the database, which is whats causing the query issue. If anyone could help me, it would be very much appreciated it.
  4. Hi Mates, Please there is this application I was working on with a friend before we lost contact. I am required to make the following changes and as well updates on the script which I encountered some difficulties in. 1. Upon Selection of Assigned Court, the Name of Judge and his Court Location should be auto selected on the Add New Entry page.. The Second Icon.. I have been able to to for Court and Judge name but want it as Court, Judge and Location 2.. Adding of New user should now be • Full Names • User Name • Department • Designation • Mobile Phone number • Email • Type • Password • Uploading of Passport Photograph 3. There should be record upload counts per user 4. Capture User activities – Login time, Idle time, Logout time with date 5. On the Report page, Status of cases per court should be included and more so report should be in Bar chat format 6. ADVANCED SEARCH : Search by Court Number should be included
  5. I have this dependent radio and dropdown box, it works fine. Now I am trying to validate and its failing to validate. When i click on a radio button it should display "select a make" and If i dont select anything it should prompt me to select something rather than just submit. Also when i try to reset, what ever ive selected does not clear away. Any help will be great. Thanks in advance. Original code is from http://forums.phpfreaks.com/topic/145947-radio-button-to-change-drop-down-fields/ <html> <head> </head> <body> <form id="formname" name="formname" method="post" action="#" onsubmit="return validate()"> Make:<br> <input type="radio" name="make" value="Chrysler" onclick="changeMake(this.value);"> Chrysler<br /> <input type="radio" name="make" value="Ford" onclick="changeMake(this.value);"> Ford<br /> <input type="radio" name="make" value="GMC" onclick="changeMake(this.value);"> GMC<br /> <br> Model: <select name="model" id="model" onchange="changeModel(this.value);" disabled="disabled"> <option> -- Select a Make -- </option> </select> <br><br> Output: <span id="output"></span> <input type="reset"> <input type="submit"> </form> </body> <script type="text/javascript"> var models = new Array(); models['Chrysler'] = ['Pacifica', 'PT Cruiser', 'Sebring']; models['Ford'] = ['Ranger', 'Taurus', 'Mustang']; models['GMC'] = ['Acadia', 'Sierra', 'Yukon']; function changeMake(make) { var modelList = models[make]; changeSelect('model', modelList, modelList); document.getElementById('model').disabled = false; document.getElementById('model').onchange(); } function changeModel(modelValue) { document.getElementById('output').innerHTML = modelValue; return; } function changeSelect(fieldID, newValues, newOptions) { selectField = document.getElementById(fieldID); selectField.options.length = 0; if (newValues && newOptions) { for (i=0; i<newValues.length; i++) { selectField.options[selectField.length] = new Option(newOptions[i], newValues[i]); } } } </script> </html>
  6. My drop down input doesn't pass the value to the next page correctly echo " <select name='NexternalStocker'> <option value='NULL'>Select</option> <option value='NULL'>-----</option>"; while ($row2 = mysql_fetch_assoc($result2)) { echo "<option value='$row2[external_Stocker]'>$row2[external_Stocker]</option>"; } echo " </select>"; Despite the drop down menu item appearing correctly on the page, "$_POST['Nexternal_Stocker'];" won't retrieve anything on the next page... can anyone give me any pointers?
  7. I'm taking this class and we've just started to learn PHP so I am really new to the subject. I have done some coding and have been emailing my instructor (he has not responded yet) so please do not just click the back button thinking all I want is the answer. Here is what I need to accomplish: Create a "self-processing" PHP page that will initially just display a simple form with a drop-down select box that lets the user choose between the feedback and help request forms. When the user makes a selection, instead of using JavaScript to dynamically build or reveal the appropriate submission form, the form will be submitted back to the same page on the server for further processing. The PHP page will use a PHP script to check if the user has submitted a choice, and if so it will dynamically display the appropriate form. This is what my assignment looks like so far: http://www2.esc.edu/jvooris/assignment5-2.php As you can see, the forms are already displayed even without selecting an option from the drop down menu. What I need to have happen is have that drop down menu appear and then have the appropriate form display after the user clicks the submit button. So if the user clicks the submit button when the option is still on "Please select the form you want to fill out" then nothing should be displayed. However, if the user clicks the submit button when they select the option "Feedback Form" then that form will appear on the page and the same goes for the "Help Form". When I emailed my instructor he said that I need to: "Create a PHP page with a form with a drop down menu and a submit button that has a action to post to itself" and "Add PHP code at the top using the isset method to test to see if the page was submitted to itself and if your drop down menu variable was sent." Like I said, I do have some code already written. My problem is trying to figure out how to make it work correctly and I can't tell if I am way off base with the code I already have or if I just need to tweak a few things. I would appreciate any help in this matter and I hope I did not do too much explaining to deter anyone. Thank you. I will post my code below (I have cut out the code for the forms to shorten the code). <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>PHP Form</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <link rel="stylesheet" href="styles.css" type="text/css" /> <!--This links the entire page to the CSS style sheet. The font sizes, colors, colors on the page, etc. are all created on the attached style sheet--> </head> <body> <div id="wrapper"> <!--This statement makes the entire page align to a specific setting as set in the CSS.--> <!--This code first appears on the page to allow the user to select an option--> <form action="assignment5-2.php" name="select"> <p><select name="formChoice" size="1"> <option value="0">Please select the form you want to fill out</option> <?php $formChoice=$_GET["formChoice"]; echo $formChoice; if($formChoice==1)echo "<option value=1 selected='selected'>Feedback Form</option>"; else echo "<option value=1>Feedback Form</option>"; if($formChoice==2)echo "<option value=2> selected='selected'>Help Form</option>"; else echo "<option value=2>Help Form</option>"; ?> <input type="submit" value="Submit"/> </select> </form> <form id="feedbackForm" action="assignment5-2.php" method="GET"> <h1>User Feedback</h1>
  8. Hey there, Hoping someone can help me. I am trying to create a page on a wordpress site that will enable users to select 4 seperate fields from 4 drop down lists, hit a submit button and then be presented with search results from a MYSQL query based on their selections from the drop down list. I am a complete noob at php and MYSQL having not touched either since Uni. Please help out if you can. Here is the code. I have omitted the database connection details for obvious reasons. //Select City from Users table $queryCity = "SELECT City FROM Users"; $resultCity = mysql_query($queryCity) or die(mysql_error()); //Select AO from Users table $queryAO = "SELECT AO FROM Users"; $resultAO = mysql_query($queryAO) or die(mysql_error()); //Select Job from Users table $queryJob = "SELECT Job FROM Users"; $resultJob = mysql_query($queryJob) or die(mysql_error()); //Select Skills from Users table $querySkills = "SELECT Skills FROM Users"; $resultSkills = mysql_query($querySkills) or die(mysql_error()); //Create City dropdown list object $dropdownCity = "<select name='selectCity'>"; while($rowCity = mysql_fetch_assoc($resultCity)) { $dropdownCity .= "\r\n<option value='{$rowCity['City']}'>{$rowCity['City']}</option>"; } $dropdownCity .= "\r\n</select>"; //Create AO dropdown list object $dropdownAO = "<select name='selectAO'>"; while($rowAO = mysql_fetch_assoc($resultAO)) { $dropdownAO .= "\r\n<option value='{$rowAO['AO']}'>{$rowAO['AO']}</option>"; } $dropdownAO .= "\r\n</select>"; //Create Job dropdown list object $dropdownJob = "<select name='selectJob'>"; while($rowJob = mysql_fetch_assoc($resultJob)) { $dropdownJob .= "\r\n<option value='{$rowJob['Job']}'>{$rowJob['Job']}</option>"; } $dropdownJob .= "\r\n</select>"; //Create Skills dropdown list object $dropdownSkills = "<select name='selectSkills'>"; while($rowSkills = mysql_fetch_assoc($resultSkills)) { $dropdownSkills .= "\r\n<option value='{$rowSkills['Skills']}'>{$rowSkills['Skills']}</option>"; } $dropdownSkills .= "\r\n</select>"; //Print the drop downlists on the page echo "Please choose from the following fields below:"; echo "Location &nbsp&nbsp&nbsp"; echo $dropdownCity; echo "AO Level &nbsp&nbsp&nbsp"; echo $dropdownAO; echo "Occupation &nbsp&nbsp&nbsp"; echo $dropdownJob; echo "Skills &nbsp&nbsp&nbsp"; echo $dropdownSkills; ?> <form method="post" action="mypage.php"> <input type="submit" value="submit" name="Submit"> <?php //This code is for retrieving the results of the drop down selections after the submit button is clicked $selectionCity = $_POST["selectSkills"]; $selectionJob = $_POST["selectJob"]; //SQL query from retrieved results //SQL query from retrieved results $sqlresults = "SELECT * FROM Users WHERE City='"$selectionCity"' AND Job='"$selectionJob"'"; $sqlpost = mysql_query($sqlresults) or die(mysql_error()); echo $sqlpost; ?> I know the page looks horrible, trying to tackle one issue at a time and get this functional. Thanks for any and all help.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.