Skip to main content

Posts

Showing posts with the label dropdown

Simple Drop Down Menu with Jquery and CSS

his post is very basic level Jquery and CSS implementation. I want to explain how to design simple drop down menu  with CSS, HTML and Jquery. This system helps you to minimise the menus list. Just take a quick look at this post very few lines of code, use it and enrich your web projects.  Download Script       Live Demo HTML Code Simple HTML code <div class=" dropdown "> <a class=" account " > My Account </a> <div class=" submenu "> <ul class=" root "> <li > <a href=" #Dashboard " > Dashboard </a> </li> <li > <a href=" #Profile " > Profile </a> </li> <li > <a href=" #settings "> Settings </a> </li> <li > <a href=" #feedback "> Send Feedback </a> </li> </ul> </div> </div> JavaScript Contains javascipt code.  $(".account").click(function(){} -  ac

Change dropdown list (options) values from database with ajax and php

I’m going to show you a example in php and ajax to change the values of the dropdown’s options without refreshing the page. The values (options) of the dropdown are fetched from the database and the certain portion of the web pages is only refreshed without need to refresh the whole page. Let’s start with creating the two tables country and city and insert some data CREATE TABLE country ( id tinyint(4) NOT NULL auto_increment, country varchar(20) NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM;CREATE TABLE city ( id tinyint(4) NOT NULL auto_increment, city varchar(50) default NULL, countryid tinyint(4) default NULL, PRIMARY KEY (id) ) TYPE=MyISAM; Now let’s look at the html code, let’s look at the code of the form and its elements <form method="post" action="" name="form1"> Country : <select name="country" nChange="getCity('findcity.php?country='+this.value)"> <option