Search Results

Search found 1524 results on 61 pages for 'dropdown'.

Page 11/61 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Zend Linked or Dependent DropDowns

    - by LookUp Webmaster
    Hello, Does anyone knows how to properly make dependent dropdowns using the Zend Framework? I've found several ways to do so, but none of them is using the framework features. Dependent Dropdown: The options shown on the "B" , depends on the option selected on the "A" . Thanks for your help, Best regards,

    Read the article

  • How to copy items from a dropdownbox to another [C#]

    - by LuRsT
    How can I copy items hardcoded from one dropdown box to another keeping the keys and values? drpTypes.Items.Add(new ListItem("Tipos de Acções", "1")); drpTypes.Items.Add(new ListItem("Tipos de Combustível", "2")); drpTypes.Items.Add(new ListItem("Tipos de Condutor", "3")); drpTypesCreateEdit.Items.AddRange(drpTypes.Items);

    Read the article

  • How to Select Items in Dropdown in Selenium

    - by Marcus Gladir
    Firstly, I have been trying to get the dropdown from this web page: http://solutions.3m.com/wps/portal/3M/en_US/Interconnect/Home/Products/ProductCatalog/Catalog/?PC_Z7_RJH9U5230O73D0ISNF9B3C3SI1000000_nid=RFCNF5FK7WitWK7G49LP38glNZJXPCDXLDbl This is the code I have: import urllib2 from bs4 import BeautifulSoup import re from pprint import pprint import sys from selenium import common from selenium import webdriver import selenium.webdriver.support.ui as ui from boto.s3.key import Key import requests url = 'http://solutions.3m.com/wps/portal/3M/en_US/Interconnect/Home/Products/ProductCatalog/Catalog/?PC_Z7_RJH9U5230O73D0ISNF9B3C3SI1000000_nid=RFCNF5FK7WitWK7G49LP38glNZJXPCDXLDbl' element_xpath = '//*[@id="Component1"]' driver = webdriver.PhantomJS() driver.get(url) element = driver.find_element_by_xpath(element_xpath) element_xpath = '/option[@value="02"]' all_options = element.find_elements_by_tag_name("option") for option in all_options: print("Value is: %s" % option.get_attribute("value")) option.click() source = driver.page_source.encode('utf-8', 'ignore') driver.quit() source = str(source) soup = BeautifulSoup(source, 'html.parser') print soup What prints out is this: Traceback (most recent call last): File "../../../../test.py", line 58, in <module> Value is: XX main() File "../../../../test.py", line 46, in main option.click() File "/home/eric/dev/octocrawler-env/local/lib/python2.7/site-packages/selenium-2.33.0-py2.7.egg/selenium/webdriver/remote/webelement.py", line 54, in click self._execute(Command.CLICK_ELEMENT) File "/home/eric/dev/octocrawler-env/local/lib/python2.7/site-packages/selenium-2.33.0-py2.7.egg/selenium/webdriver/remote/webelement.py", line 228, in _execute return self._parent.execute(command, params) File "/home/eric/dev/octocrawler-env/local/lib/python2.7/site-packages/selenium-2.33.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 165, in execute self.error_handler.check_response(response) File "/home/eric/dev/octocrawler-env/local/lib/python2.7/site-packages/selenium-2.33.0-py2.7.egg/selenium/webdriver/remote/errorhandler.py", line 158, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementNotVisibleException: Message: u'{"errorMessage":"Element is not currently visible and may not be manipulated","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Length":"81","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:51413","User-Agent":"Python-urllib/2.7"},"httpVersion":"1.1","method":"POST","post":"{\\"sessionId\\": \\"30e4fd50-f0e4-11e3-8685-6983e831d856\\", \\"id\\": \\":wdc:1402434863875\\"}","url":"/click","urlParsed":{"anchor":"","query":"","file":"click","directory":"/","path":"/click","relative":"/click","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/click","queryKey":{},"chunks":["click"]},"urlOriginal":"/session/30e4fd50-f0e4-11e3-8685-6983e831d856/element/%3Awdc%3A1402434863875/click"}}' ; Screenshot: available via screen And the weirdest most infuriating bit of it all is that sometimes it actually all works out. I have no clue what's going on here.

    Read the article

  • Customize jQuery.aptags plugin - mouseclick submit from dropdown list

    - by atmorell
    Hello, I am using jquery.autocomplete.js and jquery.apitags to select a few elements from a dropdown list. This works great, and I can select multiple elements etc. However the jquery-aptags plugin does only fire when enter is pressed. This might confuse some users if they use the mouse to click instead of the arrows/enter on the keyboard. I think this is the code inside jquery.aptags that submits the tag. // // Hook to the keypress event. // $(this).bind('keypress', { __c: __c }, function (e) { var c = ''; var i = 0; var v = $(this).val(); if (e.keyCode == 13) { e.stopPropagation(); e.preventDefault(); __createSpans(this, v, e.data.__c, true); } }); I am wondering if it is possible to call the method directly from a new event. $('.ac_results > ul > li').livequery(function() { $(this).bind('click', function() { $('#address_city').aptags({__createSpans}); }); }); Any thoughts?

    Read the article

  • Magento Replacing super attributes table with dropdown

    - by thrice801
    Hi, I am trying to replace my magento super attributes table with a drop down menu in place of it, Ive got the menu created but I am struggling to get it to actually use the data from the select dropdown. On submit it calls up function productAddToCartForm, which I feel like if I could modify, I could figure it out. But I have no idea where that function is. My php code looks like the following. <?php if (count($_associatedProducts)): ?> <select name="selectedSku"> <?php foreach ($_associatedProducts as $_item): ?> <?php $prodname = $this->htmlEscape($_item->getName()); $prodprice = $this->htmlEscape($_item->getPrice()); $prodcolor = $_item->getFullColor(); $prodsize = $_item->getTopSize(); $prodcombined = $prodname; $prodcombined .= " / "; $prodcombined .= $prodprice; echo "<option "; echo "value ='"; echo $_item->getId(); echo "'>"; echo $prodcombined; echo "</option>"; ?> <?php endforeach; ?> </select> Any help would be much appreciated. Thanks!

    Read the article

  • how to place dropdown list box in jquery grid column

    - by kumar
    Hello friends, I have a jquery grid columns defined like this.. using System; using System.Collections.Generic; using System.Linq; using System.Web; using Trirand.Web.Mvc; using System.Web.UI.WebControls; namespace JQGridMVCExamples.Models { public class OrdersJqGridModel { public OrdersJqGridModel() { OrdersGrid = new JQGrid { Columns = new List<JQGridColumn>() { new JQGridColumn { DataField = "OrderID", Width = 50 }, new JQGridColumn { DataField = "OrderDate", Width = 100, DataFormatString = "{0:d}" }, new JQGridColumn { DataField = "CustomerID", Width = 100 }, new JQGridColumn { DataField = "Freight", Width = 75 }, new JQGridColumn { DataField = "ShipName" } }, Width = Unit.Pixel(640) }; OrdersGrid.ToolBarSettings.ShowRefreshButton = true; } public JQGrid OrdersGrid { get; set; } } } and in the view I am caling like this <div> <%= Html.Trirand().JQGrid(Model.OrdersGrid, "JQGrid1") %> </div> I am getting result perfect.. but for column Freight in the Jquery grid I need to place a dropdown list dynamically for all result rows.. can anyone help me out.. THanks

    Read the article

  • Yii CGridView and dropdown filter

    - by Dmitriy Gunchenko
    I created dropdown filter, it's display, but don't worked right. As I anderstand trouble in search() method view: $this->widget('zii.widgets.grid.CGridView', array( 'dataProvider'=>$model->search(), 'filter' => $model, 'columns'=>array( array( 'name' => 'client_id', 'filter' => CHtml::listData(Client::model()->findAll(), 'client_id', 'name'), 'value'=>'$data->client->name' ), 'task' ) )); I have to tables, and they relations are shown down model: public function relations() { // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( 'client' => array(self::BELONGS_TO, 'Client', 'client_id'), ); } public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->with = array('client'); $criteria->compare('task_id',$this->task_id); $criteria->compare('client_id',$this->client_id); $criteria->compare('name',$this->client->name); $criteria->compare('task',$this->task,true); $criteria->compare('start_date',$this->start_date,true); $criteria->compare('end_date',$this->end_date,true); $criteria->compare('complete',$this->complete); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }

    Read the article

  • DropDown Box + Update Panel

    - by bExplosion
    Hey I'm having an issue updating a dropdown box inside of an update panel. Works perfectly if the page posts back, but I'd prefer seemless loading: Here my form code: <asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="ajaxClassifications" UpdateMode="Conditional" runat="server"> <ContentTemplate> <td style="font-size: small; color: #003853; width: 50%;"> <asp:DropDownList AutoPostBack="true" ID="ddlClassifications" runat="server" Width="99%" Style="font-size: medium" OnSelectedIndexChanged="ddlClassifications_SelectedIndexChanged"> </asp:DropDownList> </td> <td style="font-size: small; color: #003853; width: 50%;"> <asp:DropDownList ID="ddlSubClassifications" runat="server" Width="99%" Style="font-size: medium"> </asp:DropDownList> </td> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="ddlClassifications" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel> Heres the code in my code behind: protected void ddlClassifications_SelectedIndexChanged(object sender, EventArgs e) { ddlSubClassifications.Items.Clear(); getSubClassifications(int.Parse(ddlClassifications.SelectedValue)); } Is there something I am missing here? Thanks in advance!

    Read the article

  • Dropdown not working in some IE 6 browsers

    - by James Thomas
    We unfortunately find ourselves having to support our product in IE 6 because some of our largest users use it. One of them called today and told me that one of the dropdowns doesn't work when he clicks on it - it simply selects the first item. I checked the markup and the entire contents of the select control are being sent: <select onchange="SDateFilter_S('#ctlDateRange')" size="1" name="ctlDateRange" style="width:100px;"> <option selected="selected" value="0"> All Dates </option><option value="1"> Within </option><option value="2"> Before </option><option value="3"> After </option><option value="4"> Between </option><option value="5"> Last </option><option value="6"> Since </option> </select> This is done in ASP .NET but I am fairly certain the issue isn't with ASP .NET as when I try it in my copy of IE 6, it works correctly. Do you have any idea what would cause a dropdown list in some copies of IE 6 to effectively not work?

    Read the article

  • writing output to a dropdown list

    - by sushant
    <% dim req_id req_id=Request.Form("Req_id") Set conn=server.CreateObject("adodb.connection") conn.Open session("Psrconnect") Set rs=CreateObject("Adodb.Recordset") rs.Open "select * from releases where project like '%"&req_id&"%'", conn %> <SELECT style="LEFT: 454px; WIDTH: 500px; TOP: 413px" name="txtrelease1" id="txtrelease1"> <% if rs.EOF=true then %> <OPTION value="NO Request to Edit">No Request to Edit</OPTION> <% else do while rs.EOF<>true p=InStrRev(rs.Fields(0),"\") q=Len(rs.Fields(0)) r=(Right(rs.Fields(0),(q-p))) %> <OPTION value=<%=rs.Fields(0)%>> r </OPTION> <% rs.movenext loop end if %> </SELECT> i want to right the value of r in the dropdown list. i dont know the syntax. as of now the drop down list shows "r" , not the value inside it. how to do it?

    Read the article

  • Get value of selected field from a dropdown list

    - by 47
    I have this class in my model: class ServiceCharge(models.Model): name = models.CharField(max_length=30) amount = models.PositiveIntegerField() extends_membership = models.BooleanField(default=False) def __unicode__(self): return str(self.name) What I want to have is in the form for charging users a service charge, when a charge is selected from the dropdown menu, the two values for amount and extends_membership are updated on the form depending on the selected charge. My forms.py: class vModelChoiceField(forms.ModelChoiceField): def label_from_instance(self, obj): return "%s" % obj.name class PayServiceChargeForm(PaymentsForm): service_charge = vModelChoiceField(queryset=ServiceCharge.objects.all(), empty_label=" ") class Meta(PaymentsForm.Meta): exclude = ('member', 'payment_type', 'transacted_by', 'description') Then the form template: <table border="0"> <tr> <td><strong>{% trans "Service Charge" %}</strong></td> <td>{{ form.service_charge }}</td> <td><strong>{% trans "Extends Membership" %}</strong></td> <td>{{ form.extends_membership }}</td> </tr> <tr> <td valign="top"><strong>{% trans "Expiry Date" %}</strong></td> <td valign="top">{{ form.expiry_date }}</td> <td valign="top"><strong>{% trans "Amount" %}</strong></td> <td>{{ form.amount }}</td> </tr> </table> I was trying out some jQuery but I got stuck after getting the currently selected charge: <script type="text/javascript"> $(document).ready(function(){ $("#id_service_charge").change(onSelectChange); }); function onSelectChange(){ var selected = $("#id_service_charge option:selected"); var output = ""; if(selected.val() != 0){ charge = selected.val(); .... (update values) .... } } </script>

    Read the article

  • Creating a Month Dropdown in C# ASP.NET MVC

    - by Chris M
    This method seems stupid and a bit heavy; is there a more optimal way of creating the same thing (its for an MVC View Dropdown) private List<KeyValuePair<int, string>> getMonthListDD { get { var dDur = new List<KeyValuePair<int, string>>(); dDur.Add(new KeyValuePair<int, string>(1, "January")); dDur.Add(new KeyValuePair<int, string>(2, "Febuary")); dDur.Add(new KeyValuePair<int, string>(3, "March")); dDur.Add(new KeyValuePair<int, string>(4, "April")); dDur.Add(new KeyValuePair<int, string>(5, "May")); dDur.Add(new KeyValuePair<int, string>(6, "June")); dDur.Add(new KeyValuePair<int, string>(7, "July")); dDur.Add(new KeyValuePair<int, string>(8, "August")); dDur.Add(new KeyValuePair<int, string>(9, "September")); dDur.Add(new KeyValuePair<int, string>(10, "October")); dDur.Add(new KeyValuePair<int, string>(11, "November")); dDur.Add(new KeyValuePair<int, string>(12, "December")); return dDur; } }

    Read the article

  • Dropdown OnSelectedIndexChanged not firing

    - by Jim
    The OnSelectedIndexChanged event is not firing for my dropdown box. All forums I have looked at told me to add the AutoPostBack="true", but that didn't change the results. HTML: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" Text="Current Time: " /> <br /> <asp:Label ID="lblCurrent" runat="server" Text="Label" /><br /><br /> <asp:DropDownList ID="cboSelectedLocation" runat="server" AutoPostBack="true" OnSelectedIndexChanged="cboSelectedLocation_SelectedIndexChanged" /><br /><br /> <asp:Label ID="lblSelectedTime" runat="server" Text="Label" /> </div> </form> </body> </html> Code behind: public partial class _Default : System.Web.UI.Page { string _sLocation = string.Empty; string _sCurrentLoc = string.Empty; TimeSpan _tsSelectedTime; protected void Page_Load(object sender, EventArgs e) { AddTimeZones(); cboSelectedLocation.Focus(); lblCurrent.Text = "Currently in " + _sCurrentLoc + Environment.NewLine + DateTime.Now; lblSelectedTime.Text = _sLocation + ":" + Environment.NewLine + DateTime.UtcNow.Add(_tsSelectedTime); } //adds all timezone displaynames to combobox //defaults combo location to seoul, South Korea //defaults current location to current location private void AddTimeZones() { foreach(TimeZoneInfo tz in System.TimeZoneInfo.GetSystemTimeZones()) { string s = tz.DisplayName; cboSelectedLocation.Items.Add(s); if (tz.StandardName == "Korea Standard Time") cboSelectedLocation.Text = s; if (tz.StandardName == System.TimeZone.CurrentTimeZone.StandardName) _sCurrentLoc = tz.StandardName; } } //changes timezone name and time depending on what is selected in the cbobox. protected void cboSelectedLocation_SelectedIndexChanged(object sender, EventArgs e) { foreach (TimeZoneInfo tz in System.TimeZoneInfo.GetSystemTimeZones()) { if (cboSelectedLocation.Text == tz.DisplayName) { _sLocation = tz.StandardName; _tsSelectedTime = tz.GetUtcOffset(DateTime.UtcNow); } } } } Any advice into what to look at for a rookie asp coder? EDIT: added more code behind

    Read the article

  • I have a php form dropdown menu that needs to send information

    - by shinjuo
    I have a dropdown menu that is filled by a mysql database. I need to select one and have it send the information for use on the next page after clicking submit. It does populate the drop down menu like it is supposed to it just does not seem to catch the data on the next page. Here is what I have: removeMain.php <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <form action="remove.php" method="post"> <?php $link = mysql_connect('********', '********', '*********'); if (!$link){ die('Could not connect: ' . mysql_error()); } mysql_select_db("********", $link); $res = mysql_query("SELECT * FROM cardLists order by cardID") or die(mysql_error()); echo "<select name = CardID>"; while($row=mysql_fetch_assoc($res)) { echo "<option value=$row[ID]>$row[cardID]</a></option>"; } echo "</select>"; ?> Amount to Remove: <input type="text" name="Remove" /> <input type="submit" /> </form> <body> </body> </html> remove.php <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <body> <?php $link = mysql_connect('*********', '*********', '*********'); if (!$link){ die('Could not connect: ' . mysql_error()); } mysql_select_db("***********y", $link); $query = sprintf("UPDATE cardLists SET AmountLeft = AmountLeft - %s WHERE cardID = '%s'", mysql_real_escape_string($_POST["Remove"]), mysql_real_escape_string($_POST["CardID"])); mysql_query($query); mysql_close($link); ?> <br /> <a href="removeMain.php"> <input type="submit" name="return" id="return" value="Update More" /></a> <a href="index.php"> <input type="submit" name="main" id="main" value="Return To Main" /></a> </body> </html>

    Read the article

  • There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key 'xxx'.

    - by Jimbo
    There are a couple of posts about this on Stack Overflow but none with an answer that seem to fix the problem in my current situation. I have a page with a table in it, each row has a number of text fields and a dropdown. All the dropdowns need to use the same SelectList data so I have set it up as follows: Controller ViewData["Submarkets"] = new SelectList(submarketRep.AllOrdered(), "id", "name"); View <%= Html.DropDownList("submarket_0", (SelectList)ViewData["Submarkets"], "(none)") %> I have used exactly this setup in many places, but for some reason in this particular view I get the error: There is no ViewData item of type 'IEnumerable' that has the key 'submarket_0'.

    Read the article

  • Jquery dependent dropdown doesn't work in IE

    - by earlyriser
    I have a 3 dropdowns: countries, states, and cities. States and cities are dependent of the previous form and loaded via AJAX. In Firefox and Chrome everything is ok, but in IE (8 in my case) when I select a state, the cities dropdown isn't loaded. It is like IE don't detect the change. It is not a load problem, because I have tested with a simple alert box. Any help will be really appreciated. The states loaded page is similar to: <div id="states"> <select id="woeid_state"> <option value="1">Alabama</option> <option value="2">Florida</option> </select> </div> The cities loaded page is similar to: <div id="towns"> <select id="woeid_town"> <option value="100">Miami</option> <option value="101">Orlando</option> </select> </div> The JS $(document).ready(function() { function loadStates( parent_woeid ) { $('#states').load("<?php echo $states_page?>"+parent_woeid); return false; } function loadCities( parent_woeid ) { $('#towns').load("<?php echo $cities_page;?>/admin1/"+parent_woeid); return false; } $("#woeid_country").change(function() { //alert("I am an alert box"); var country = $("select#woeid_country").val(); loadStates ( country); }); $("#states").change(function() { //alert("I am an alert box"); var admin1 = $("select#woeid_state").val(); loadCities ( admin1 ); }); }); The form: <form class="ordinary_form" method="post" action=""> <label>Country</label> <select name="woeid_country" id="woeid_country"> <option value="23424975">United Kingdom</option> <option value="23424977">United States</option> <option value="23424979">Uruguay</option> <option value="23424980">Uzbekistan</option> <option value="23424907">Vanuatu</option> <option value="23424982">Venezuela</option> <option value="23424984">Vietnam</option> </select> <label>State/Province</label> <div id="states"></div> <label>City</label> <div id="towns"></div> </form>

    Read the article

  • Dropdown dependent values to be fetch from multiple models using ajax in Yii

    - by newuser
    I searched all the documentation over Yii but not got the answer of it.So I came here finally. I have the following schema Table Schools +------------------+--------------+------+-----+---------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------------------+----------------+ | id | int(10) | NO | PRI | NULL | auto_increment | | school_name | varchar(100) | NO | | | | +------------------+--------------+------+-----+---------------------+----------------+ Table Students +------------------+--------------+------+-----+---------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------------------+----------------+ | id | int(10) | NO | PRI | NULL | auto_increment | | school_id | int(10) | NO | FK | | | | student_name | varchar(100) | NO | | | | | roll_no | varchar(80) | NO | | | | | class | varchar(20) | NO | | | | | | subjects | varchar(100) | NO | | | | +------------------+--------------+------+-----+---------------------+----------------+ I have made models and CRUD for the both models.In models my relation is like this In Students.php the relation is like public function relations() { // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( 'School' => array(self::BELONGS_TO,'Schools','school_id'), ); } In Schools.php the relation is like public function relations() { // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( 'student' => array(self::HAS_MANY, 'Students', 'school_id'), ); } Now I made the two models rendered in a single page so that I can enter all the respective fields in a single form. In the _form.php file of Students I have made some change in student_name like this <div class="row"> <?php echo $form->labelEx($model,'student_name'); ?> <?php echo $form->dropdownList($model,'student_name', CHtml::listData(Students::model()->findAll(), 'id', 'student_name'), array('empty'=>array('Select'=>'--Select One---'))); ?> <?php echo $form->error($model,'student_name'); ?> Now for this piece of code I got all the student name from the Student model. So my problem is when I am getting the student name from the dropdown list and going to select a student it will also fetch all the respective values of the student to be rendered in the _form.php without click on save button.So that user don't have to put it again manually. I think ajax and json encode will work here but don't know how to make them work here. [Update] Here is StudentsController code public function actionDisCoor() { $model = School::model()->findByPk($_POST['Students']['student_id']); $data=CHtml::listData($data,'id','name'); foreach($data as $value=>$name) { echo CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true); } } Here is _form.php code for Students <div class="row"> <?php echo $form->labelEx($model,'student_name'); ?> <?php $List = CHtml::listData(Students::model()->findAll(), 'id', 'student_name'); ?> <?php echo $form->dropdownList($model,'student_name',$List, array('onChange'=>CHtml::ajax(array( 'url' => CController::createUrl('DisCoor'), 'type' => 'POST', 'update'=>'#school_id', )),'style'=>'width:180px;' ) )?> <?php echo $form->error($model,'student_name'); ?> </div> After all that when I saw in firebug I got the error.Here is the screen shot

    Read the article

  • Creating a menu to switch languages on site

    - by user342391
    I have a dropdown menu on my site that I want to use to switch between the different languages: <select onChange="if(this.selectedIndex!=0) self.location=this.options[this.selectedIndex].value" name="userLanguage" id="userLanguage"> <option value="http://demo.com/?lang=en"> English (International)</option> <option value="http://demo.com/?lang=es"> Español (European)</option> </select> How can I get the above menu to display which language is currently showing. Is there someway of showing an active state. Site is using php. Thanks in advance.

    Read the article

  • Using 'ref code' related to the spinner option chosen

    - by user1508541
    I am trying to add a spinner function in a trial app which compares the frequency charts of earphones. I am trying to extract the info from " http://www.headphone.com/learning-center/build-a-graph.php " website. what I want to do is make the spinner work like the drop down list in the mentioned website. On further inspection what I found was that every dropdown element is provided with a unique code that is called when the particular element is selected. I need help in replicating the same in an android spinner.

    Read the article

  • Cant center dropdown menu

    - by sonicboom
    I have a dropdown below ive creaeted, but im having troulbe centering the the menu. Ive tried to put <center> tags around it and also set the ul to margin auto 0 but its not working. Is there anything im missing? <style type="text/css"> ul { font-family: Arial, Verdana; font-size: 14px; margin: 0; padding: 0; list-style: none; } ul li { display: block; position: relative; float: left; } li ul { display: none; } ul li a { display: block; text-decoration: none; color: #ffffff; border-top: 1px solid #ffffff; padding: 5px 15px 5px 15px; background: #1e7c9a; margin-left: 1px; white-space: nowrap; } ul li a:hover { background: #3b3b3b; } li:hover ul { display: block; position: absolute; } li:hover li { float: none; font-size: 11px; } li:hover a { background: #3b3b3b; } li:hover li a:hover { background: #1e7c9a; } </style> </head> <body> <ul id="menu"> <li><a href="#">Home</a></li> <li><a href="#">Portfolio</a> <ul> <li><a href="#">Web Design</a></li> <li><a href="#">Graphic Design</a></li> <li><a href="#">Logo Design</a></li> <li><a href="#">Blog Design</a></li> </ul> </li> <li><a href="#">Projects</a> <ul> <li><a href="#">This is a project</a></li> <li><a href="#">So is this</a></li> <li><a href="#">and this</a></li> <li><a href="#">don't forget this too</a></li> </ul> </li> <li><a href="#">Contact</a> <ul> <li><a href="#">Support</a></li> <li><a href="#">Quote</a></li> <li><a href="#">General Enquiry</a></li> </ul> </li> </ul> I went ahead and put it on jsfiddle Here

    Read the article

  • CSS Dropdown Menu issues

    - by Simon Hume
    Can anyone help with a small problem. I've got a nice simple CSS dropdown menu http://www.cinderellahair.co.uk/new/CSSDropdown.html The problem I have is when you rollover a menu item that has children which are wider than the content, it pushes the whole menu right. Aside of shortening the child menu links down, is there any tweak I can make to my CSS to stop this happening? CSS Code: /* General */ #cssdropdown, #cssdropdown ul { list-style: none; } #cssdropdown, #cssdropdown * { padding: 0; margin: 0; } #cssdropdown {padding:43px 0px 0px 0px;} /* Head links */ #cssdropdown li.headlink { margin:0px 40px 0px -1px; float: left; background-color: #e9e9e9;} #cssdropdown li.headlink a { display: block; padding: 0px 0px 0px 5px; text-decoration:none; } #cssdropdown li.headlink a:hover { text-decoration:underline; } /* Child lists and links */ #cssdropdown li.headlink ul { display: none; text-align: left; padding:10px 0px 0px 0px; font-size:12px; float:left;} #cssdropdown li.headlink:hover ul { display: block; } #cssdropdown li.headlink ul li a { padding: 5px; height: 17px; } #cssdropdown li.headlink ul li a:hover { background-color: #333; } /* Pretty styling */ body { font-family:Georgia, "Times New Roman", Times, serif; font-size: 16px; } #cssdropdown a { color: grey; } #cssdropdown ul li a:hover { text-decoration: none; } #cssdropdown li.headlink { background-color: white; } #cssdropdown li.headlink ul { padding-bottom: 10px;} HTML: <ul id="cssdropdown"> <li class="headlink"><a href="http://www.cinderellahair.co.uk/new/index.php">HOME</a></li> <li class="headlink"><a href="http://www.cinderellahair.co.uk/new/gallery/gallery.php">GALLERY</a> <ul> <li><a href="http://amazon.com/">CELEBRITY</a></li> <li><a href="http://ebay.com/">BEFORE &amp; AFTER</a></li> <li><a href="http://craigslist.com/">HAIR TYPES</a></li> </ul> </li> <li class="headlink"><a href="http://www.cinderellahair.co.uk/new/about-cinderella-hair-extensions/about-us.php">ABOUT US</a> <ul> <li><a href="http://amazon.com/">WHY CHOOSE CINDERELLA</a></li> <li><a href="http://ebay.com/">TESTIMONIALS</a></li> <li><a href="http://craigslist.com/">MINI VIDEO CLIPS</a></li> <li><a href="http://craigslist.com/">OUR HAIR PRODUCTS</a></li> </ul> </li> <li class="headlink"><a href="http://www.cinderellahair.co.uk/new/news-and-offers/news.php">NEWS &amp; OFFERS</a> <ul> <li><a href="http://amazon.com/">VERA WANG FREE GIVEAWAY</a></li> <li><a href="http://ebay.com/">CINDERELLA ON TV</a></li> <li><a href="http://craigslist.com/">CINDERELLA IN THE PRESS</a></li> <li><a href="http://craigslist.com/">CINDRELLA NEWSLETTERS</a></li> </ul> </li> <li class="headlink"><a href="http://www.cinderellahair.co.uk/new/cinderella-salon/salon-finder.php">SALON FINDER</a></li> </ul> JS Code: $(document).ready(function(){ $('#cssdropdown li.headlink').hover( function() { $('ul', this).css('display', 'block'); }, function() { $('ul', this).css('display', 'none'); }); }); Full code is on the link above, just view source.

    Read the article

  • How to autosum value on dropdown and radio select

    - by Wilf
    I'm working on an auto calculation form which is a total column will change after a radio and a dropdown is clicked. I can make the total change for both dropdowns but the problem occurs when I tried to add a radio option. Here is my code. HTML Ages 10+: <select id="Adult" name="Adult"> <option selected="selected" value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> </select> <br />Ages 3-9: <select id="Child" name="Child"> <option selected="selected" value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> </select> <br />Food <input type="radio" name="food" id="food0" value="0" /> <label for="food0">No</label> <input type="radio" name="food" id="food1" value="10" /> <label for="food1">Yes</label> <table width="100%" border="1" align="center"> <tr> <td>Product</td> <td>Ages 10+</td> <td>Ages 3-9</td> <td>Food</td> <td>Price</td> </tr> <tr> <td>2 Day Ticket</td> <td>$235.00</td> <td>$223.00</td> <td><span id="food">0</span> </td> <td>$<span class="amount" id="2DayTotal"></span> </td> </tr> <tr> <td>3 Day Ticket</td> <td>$301.00</td> <td>$285.00</td> <td><span id="food">0</span> </td> <td>$<span class="amount" id="3DayTotal"></span> </td> </tr> <tr> <td>4 Day Ticket</td> <td>$315.00</td> <td>$298.00</td> <td><span id="food">0</span> </td> <td>$<span class="amount" id="4DayTotal"></span> </td> </tr> <tr> <td>5 Day Ticket</td> <td>$328.00</td> <td>$309.00</td> <td><span id="food">0</span> </td> <td>$<span class="amount" id="5DayTotal"></span> </td> </tr> </table> JavaScript var numAdult = 0; var numChild = 0; $("#Adult").change(function () { numAdult = $("#Adult").val(); calcTotals(); }); $("#Child").change(function () { numChild = $("#Child").val(); calcTotals(); }); $('input[type=radio]').change(function(evt) { $('#food').html($(this).val()); }); function calcTotals() { $("#2DayTotal").text(235 * numAdult + 223 * numChild); $("#3DayTotal").text(301 * numAdult + 285 * numChild); $("#4DayTotal").text(315 * numAdult + 298 * numChild); $("#5DayTotal").text(328 * numAdult + 309 * numChild); } The issues are: I'd like the food column change to it's value when a radio is click. It works only the first id. After a radio is clicked. A fumction calcTotals() is called to sum an additional food cost. Demo here : http://jsfiddle.net/4Jegn/178/ Please be advice.

    Read the article

  • ASP.NET MVC - dropdown list post handling problem

    - by ile
    I've had troubles for a few days already with handling form that contains dropdown list. I tried all that I've learned so far but nothing helps. This is my code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using CMS; using CMS.Model; using System.ComponentModel.DataAnnotations; namespace Portal.Models { public class ArticleDisplay { public ArticleDisplay() { } public int CategoryID { set; get; } public string CategoryTitle { set; get; } public int ArticleID { set; get; } public string ArticleTitle { set; get; } public DateTime ArticleDate; public string ArticleContent { set; get; } } public class HomePageViewModel { public HomePageViewModel(IEnumerable<ArticleDisplay> summaries, Article article) { this.ArticleSummaries = summaries; this.NewArticle = article; } public IEnumerable<ArticleDisplay> ArticleSummaries { get; private set; } public Article NewArticle { get; private set; } } public class ArticleRepository { private DB db = new DB(); // // Query Methods public IQueryable<ArticleDisplay> FindAllArticles() { var result = from category in db.ArticleCategories join article in db.Articles on category.CategoryID equals article.CategoryID orderby article.Date descending select new ArticleDisplay { CategoryID = category.CategoryID, CategoryTitle = category.Title, ArticleID = article.ArticleID, ArticleTitle = article.Title, ArticleDate = article.Date, ArticleContent = article.Content }; return result; } public IQueryable<ArticleDisplay> FindTodayArticles() { var result = from category in db.ArticleCategories join article in db.Articles on category.CategoryID equals article.CategoryID where article.Date == DateTime.Today select new ArticleDisplay { CategoryID = category.CategoryID, CategoryTitle = category.Title, ArticleID = article.ArticleID, ArticleTitle = article.Title, ArticleDate = article.Date, ArticleContent = article.Content }; return result; } public Article GetArticle(int id) { return db.Articles.SingleOrDefault(d => d.ArticleID == id); } public IQueryable<ArticleDisplay> DetailsArticle(int id) { var result = from category in db.ArticleCategories join article in db.Articles on category.CategoryID equals article.CategoryID where id == article.ArticleID select new ArticleDisplay { CategoryID = category.CategoryID, CategoryTitle = category.Title, ArticleID = article.ArticleID, ArticleTitle = article.Title, ArticleDate = article.Date, ArticleContent = article.Content }; return result; } // // Insert/Delete Methods public void Add(Article article) { db.Articles.InsertOnSubmit(article); } public void Delete(Article article) { db.Articles.DeleteOnSubmit(article); } // // Persistence public void Save() { db.SubmitChanges(); } } } using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Portal.Models; using CMS.Model; namespace Portal.Areas.CMS.Controllers { public class ArticleController : Controller { ArticleRepository articleRepository = new ArticleRepository(); ArticleCategoryRepository articleCategoryRepository = new ArticleCategoryRepository(); // // GET: /Article/ public ActionResult Index() { ViewData["categories"] = new SelectList ( articleCategoryRepository.FindAllCategories().ToList(), "CategoryId", "Title" ); Article article = new Article() { Date = DateTime.Now, CategoryID = 1 }; HomePageViewModel homeData = new HomePageViewModel(articleRepository.FindAllArticles().ToList(), article); return View(homeData); } // // GET: /Article/Details/5 public ActionResult Details(int id) { var article = articleRepository.DetailsArticle(id).Single(); if (article == null) return View("NotFound"); return View(article); } // // GET: /Article/Create //public ActionResult Create() //{ // ViewData["categories"] = new SelectList // ( // articleCategoryRepository.FindAllCategories().ToList(), "CategoryId", "Title" // ); // Article article = new Article() // { // Date = DateTime.Now, // CategoryID = 1 // }; // return View(article); //} // // POST: /Article/Create [ValidateInput(false)] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(Article article) { if (ModelState.IsValid) { try { // TODO: Add insert logic here articleRepository.Add(article); articleRepository.Save(); return RedirectToAction("Index"); } catch { return View(article); } } else { return View(article); } } // // GET: /Article/Edit/5 public ActionResult Edit(int id) { ViewData["categories"] = new SelectList ( articleCategoryRepository.FindAllCategories().ToList(), "CategoryId", "Title" ); var article = articleRepository.GetArticle(id); return View(article); } // // POST: /Article/Edit/5 [ValidateInput(false)] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(int id, FormCollection collection) { Article article = articleRepository.GetArticle(id); try { // TODO: Add update logic here UpdateModel(article, collection.ToValueProvider()); articleRepository.Save(); return RedirectToAction("Details", new { id = article.ArticleID }); } catch { return View(article); } } // // HTTP GET: /Article/Delete/1 public ActionResult Delete(int id) { Article article = articleRepository.GetArticle(id); if (article == null) return View("NotFound"); else return View(article); } // // HTTP POST: /Article/Delete/1 [AcceptVerbs(HttpVerbs.Post)] public ActionResult Delete(int id, string confirmButton) { Article article = articleRepository.GetArticle(id); if (article == null) return View("NotFound"); articleRepository.Delete(article); articleRepository.Save(); return View("Deleted"); } [ValidateInput(false)] public ActionResult UpdateSettings(int id, string value, string field) { // This highly-specific example is from the original coder's blog system, // but you can substitute your own code here. I assume you can pick out // which text field it is from the id. Article article = articleRepository.GetArticle(id); if (article == null) return Content("Error"); if (field == "Title") { article.Title = value; UpdateModel(article, new[] { "Title" }); articleRepository.Save(); } if (field == "Content") { article.Content = value; UpdateModel(article, new[] { "Content" }); articleRepository.Save(); } if (field == "Date") { article.Date = Convert.ToDateTime(value); UpdateModel(article, new[] { "Date" }); articleRepository.Save(); } return Content(value); } } } and view: <%@ Page Title="" Language="C#" MasterPageFile="~/Areas/CMS/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Portal.Models.HomePageViewModel>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Index </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <div class="naslov_poglavlja_main">Articles Administration</div> <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %> <% using (Html.BeginForm("Create","Article")) {%> <div class="news_forma"> <label for="Title" class="news">Title:</label> <%= Html.TextBox("Title", "", new { @class = "news" })%> <%= Html.ValidationMessage("Title", "*") %> <label for="Content" class="news">Content:</label> <div class="textarea_okvir"> <%= Html.TextArea("Content", "", new { @class = "news" })%> <%= Html.ValidationMessage("Content", "*")%> </div> <label for="CategoryID" class="news">Category:</label> <%= Html.DropDownList("CategoryId", (IEnumerable<SelectListItem>)ViewData["categories"], new { @class = "news" })%> <p> <input type="submit" value="Publish" class="form_submit" /> </p> </div> <% } %> <div class="naslov_poglavlja_main"><%= Html.ActionLink("Write new article...", "Create") %></div> <div id="articles"> <% foreach (var item in Model.ArticleSummaries) { %> <div> <div class="naslov_vijesti" id="<%= item.ArticleID %>"><%= Html.Encode(item.ArticleTitle) %></div> <div class="okvir_vijesti"> <div class="sadrzaj_vijesti" id="<%= item.ArticleID %>"><%= item.ArticleContent %></div> <div class="datum_vijesti" id="<%= item.ArticleID %>"><%= Html.Encode(String.Format("{0:g}", item.ArticleDate)) %></div> <a class="news_delete" href="#" id="<%= item.ArticleID %>">Delete</a> </div> <div class="dno"></div> </div> <% } %> </div> </asp:Content> When trying to post new article I get following error: System.InvalidOperationException: The ViewData item that has the key 'CategoryId' is of type 'System.Int32' but must be of type 'IEnumerable'. I really don't know what to do cause I'm pretty new to .net and mvc Any help appreciated! Ile EDIT: I found where I made mistake. I didn't include date. If in view form I add this line I'm able to add article: <%=Html.Hidden("Date", String.Format("{0:g}", Model.NewArticle.Date)) %> But, if I enter wrong datetype or leave title and content empty then I get the same error. In this eample there is no need for date edit, but I will need it for some other forms and validation will be necessary. EDIT 2: Error happens when posting! Call stack: App_Web_of9beco9.dll!ASP.areas_cms_views_article_create_aspx.__RenderContent2(System.Web.UI.HtmlTextWriter __w = {System.Web.UI.HtmlTextWriter}, System.Web.UI.Control parameterContainer = {System.Web.UI.WebControls.ContentPlaceHolder}) Line 31 + 0x9f bytes C#

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >