- <select id = "country">
- <option selected = "selected" value = "0">all</option>
- <option value = "1">country1</option>
- <option value = "2">country2</option>
- <option value = "3">country3</option>
- </select>
- <select id = "region">
- <option selected = "selected">all</option>
- </select>
- //add an option and it's value with jquery append and javascript split.
- //Array elements are in form of option|value
- //so that we can process them with split
- var regions = new Array()
- regions[0] = ["all|1"];
- regions[1] = ["region1|2","region2|3"]
- regions[2] = ["region3|4","region4|5"]
- regions[3] = ["region5|6","region6|7"]
- $(document).ready(function() {
- $("#country").change(function(){
- $("#region").empty()
- var v = $("#country").val()
- for(i=0; i<regions[v].length; i++)
- $("#region").append(new Option(regions[v][i].split("|")[0]),
- regions[v][i].split("|")[1])
- });
- });
- var regions = new Array()
- regions[0] = ["all|1"];
- regions[1] = ["region1|2","region2|3"]
- regions[2] = ["region3|4","region4|5"]
- regions[3] = ["region5|6","region6|7"]
Tuesday, 31 July 2012
Dynamic change of select values in a form, how to save them
Subscribe to:
Post Comments (Atom)
Popular Posts
-
File name: Ashli Orion and Georgia Jones part2.wmv Size: 188.90 MB Type: .wmv Source: http://w...
-
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JF...
-
Warning: This story contains fluffies, violence and human tragedy. Viewer discretion is advised. I don't even like c...
-
CheckBox chb = new CheckBox(); chb.InputAttributes.Add("value", "my_id_00"); chb.Text = "Title 00"; ...
-
import java.awt.BorderLayout; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Point; import ja...
-
HttpClient client = new DefaultHttpClient(); HttpPost httpPost = new HttpPost("http://simonexxx.no-ip.info/ilMercatinoDelxxx/Mod...
-
http://ul.to/so1xzfnd/Various Artists - Who Owns the Game? [iTunes Plus AAC M4A].rar http://imgchili.com/show/13303/13303501_who...
-
// the lines from which will be read $lines = "1 5 16 26"; // split these numbers above into an array $lines...
-
"30 Meters " + raw("²") def area_conversion(feet, project) if project.metric ...
-
private void Save_Click(object sender, EventArgs e) { string filePath = txtFilePath.Text; if (!Fi...
No comments:
Post a Comment