Search Results

Search found 305 results on 13 pages for 'selectedindex'.

Page 10/13 | < Previous Page | 6 7 8 9 10 11 12 13  | Next Page >

  • Preset value of HTML Forms - iPhone SDK

    - by laura
    Hi. I'm trying to preset the value of a dropdown menu and the value of a text box in an HTML form. As soon as the user taps the button in my iPhone app, it enters the webview and I was hoping to preset one of the dropdown menus and text field. How do I go about this? I want to set the dropdown to value "4" and the text field to "Giro Apps" Here's the relevant HTML form code: <select id="advSrcId" class="list" onchange="showOther($('advSrcId').options[$('advSrcId').selectedIndex].value)" name="advSrcId"> <option selected="" value="">Select</option> <option value="1">Google</option> <option value="2">Facebook</option> <option value="3">Friend Referral</option> <option value="4">Other</option> </select> <div id="otherAdvsrc" style=""> <p> Please give details here: <br/> <input class="text" type="text" value="" name="advsrc"/> <br/> </p> </div> TIA!

    Read the article

  • javascript function not working in IE 7

    - by JPro
    Hi, Can anyone please tell me how do I make this script run in IE 7? When I run this , nothing happens. <html> <body> <script language="JavaScript"> function moveSelectedOption() { // Fetch references to the <select> elements. var origin = document.getElementById('origin_select'); var target = document.getElementById('target_select'); // Fetch the selected option and clone it. var option = origin.options[origin.selectedIndex]; var copy = option.cloneNode(true); // Add the clone to the target element. target.add(copy, null); } </script> <select id="origin_select" multiple> <option value="A">A</option> <option value="B">B</option> <option value="C">C</option> </select> <select id="target_select" multiple> <option value="C1">C1</option> </select> <button onclick="moveSelectedOption()">Add</button> </body> </html>

    Read the article

  • sending a selected value from a dropdownlist to a servlet with xhr

    - by kawtousse
    I am trying to send the clicked value of a dropdown list to my servlet to run a SQL query using the value received. To do it I am using Ajax like that: function showProject(prj) { xmlhttp = GetXmlHttpObject(); if (xmlhttp == null) { alert ("Browser does not support HTTP Request"); return; } var url = "ServletxmlGenerator.java"; idprj = prj.options[prj.selectedIndex].value; url = url + "?idprj=" + idprj; xmlhttp.onreadystatechange = stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } The servlet when String projectcode=(String) request.getParameter("idprj"); returns null. When I select a value from the JSP that construct the dropdown list and from which the function showProject is handled the same thing is happned. It returns always null. So the parameter(idprj) is not passed anyway. How can I handle with this. I need to send the selected value to the servlet to run my SQL query.

    Read the article

  • I find a problem with sending receiving parameter

    - by kawtousse
    how to get the xml translation to html dropdownlist with ajax. I send the parameter with GET method but the JSP FILE THAT GENERATES THE XML DONT RECEIVE IT. var url="responsexml.jsp"; url=url+"?projectCode="+prj.options[prj.selectedIndex].value; xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); and then in responsexml.jsp I do like that: <% String projectcode= (String)request.getParameter("projectCode"); System.out.println("++++projectCode:=" +projectcode); Session s = null; Transaction tx; try { s = HibernateUtil.currentSession(); tx = s.beginTransaction(); Query query = s.createQuery("SELECT from Wa wa where wa.ProjectCode='"+projectcode+"'"); response.setContentType("text/xml"); PrintWriter output = response.getWriter(); output.write( "<?xml version=\"1.0\" encoding=\"utf-8\"?>"); //response.setHeader("Cache-Control", "no-cache"); //constriure le xml if(projectcode!=null) { for(Iterator it=query.iterate();it.hasNext();) { if(it.hasNext()) { Wa object=(Wa)it.next(); //out.print( "<item id=\"" +object.getIdWA() + "\" name=\"" + object.getWAName() + "\" />"); output.write("<wa>"); output.write( "<item id=\"" + object.getIdWA() + "\" name=\"" + object.getWAName() + "\" />"); output.write("</wa>"); } } } } catch (HibernateException e) { e.printStackTrace(); } %> </body> </html> With this code I dont have my xml file. I got this error: The server did not understand the request, or the request was invalid. Erreur de traitement de la ressource http://www.w3.o... PLEASE HELP.

    Read the article

  • Preset value of HTML Forms

    - by laura
    Hi. I'm trying to preset the value of a dropdown menu and the value of a text box in an HTML form. As soon as the user taps the button in my iPhone app, it enters the webview and I was hoping to preset one of the dropdown menus and text field. How do I go about this? I want to set the dropdown to value "4" and the text field to "Giro Apps" Here's the relevant HTML form code: <select id="advSrcId" class="list" onchange="showOther($('advSrcId').options[$('advSrcId').selectedIndex].value)" name="advSrcId"> <option selected="" value="">Select</option> <option value="1">Google</option> <option value="2">Facebook</option> <option value="3">Friend Referral</option> <option value="4">Other</option> </select> <div id="otherAdvsrc" style=""> <p> Please give details here: <br/> <input class="text" type="text" value="" name="advsrc"/> <br/> </p> </div> TIA!

    Read the article

  • Submit form with JS

    - by Thomas
    Im working with a shopping cart plugin and that uses a basic form on the product page to submit values like price, product name, etc.. The problem is that the plugin uses a standard submit button to send the values and I would like to replace said button with a prettier custom jquery rollover. In order to make this happen I used some JS and tossed a link around my custom submit button: <a href="#" onclick="document.forms[0].submit()" value="Add to Cart" onsubmit="return ReadForm(this, true);"> <img class="fade" src="style/img/add_btn.jpg" style="background: url(style/img/add_ro.png);" alt=""/> </a> The form submits and the user is redirected to the homepage but the data in the form doesn't seem to get submitted and the product never gets added to the 'cart' page. I suspect that the form is getting submitted but I am failing to fire some additional JS function that submits the data. The plugin adds some JS to the top of the page: <!-- // function ReadForm (obj1, tst) { // Read the user form var i,j,pos; val_total="";val_combo=""; for (i=0; i<obj1.length; i++) { // run entire form obj = obj1.elements[i]; // a form element if (obj.type == "select-one") { // just selects if (obj.name == "quantity" || obj.name == "amount") continue; pos = obj.selectedIndex; // which option selected val = obj.options[pos].value; // selected value val_combo = val_combo + "(" + val + ")"; } } // Now summarize everything we have processed above val_total = obj1.product_tmp.value + val_combo; obj1.product.value = val_total; } //--> If you want to check out the the site in question, take a look here and click 'add to cart button': http://hardtopdepot.com/?p=34 You can see the cart at the top: http://hardtopdepot.com/?page_id=50 Any help would be super appreciated- thanks!

    Read the article

  • populating one checkedlistbox with another (checkedlistbox)

    - by 8thWonder
    I am having difficulties populating a checkedlistbox (CLB) based on the selection(s) made in another. It should also be noted that I have a "Select All" checkbox at the top that checks/unchecks all of the items in the first CLB. Here's the code: Private Sub chkSelectAll_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkSelectAll.CheckedChanged For i As Integer = 0 To clb1.Items.Count - 1 clb1.SetItemChecked(i, chkSelectAll.Checked) Next End Sub Private Sub clb1_ItemCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles clb1.ItemCheck Dim i As Integer = clb1.SelectedIndex For j As Integer = 0 To al_2.Count - 1 If i = -1 Then For k As Integer = 0 To al_2.Count - 1 If Not clb2.Contains(al_2(k).sDate) Then clb2.Items.Add(al_2(k).sDate) Else : k += 1 End If Next ElseIf (e.NewValue = CheckState.Checked And al_2(j).sName = al_1(i)) Then clb2.Items.Add(al_2(j).sDate) ElseIf (e.NewValue = CheckState.Unchecked And al_2(j).sName = al_1(i)) Then clbProdBkups.Items.Remove(al_2(j).sDate) End If Next End Sub The first CLB is populated with an arraylist of values on the button click event. Based on whatever is checked in the first CLB, corresponding values from an arraylist of structures should fill the second CLB. The following code partially works until the "Select All" checkbox is clicked at which point one of two things happens: If other values have been selected before "Select All" is checked, the second CLB is filled with the correct number of corresponding values BUT only those of the most recently selected item of the first CLB instead of all of corresponding values of all of the items that were not already selected. When "Select All" is unchecked, the most recently incorrect values are removed, everything in CLB 1 is unchecked but the values in CLB 2 that were selected before "Select All" was checked remain. If "Select All" is checked before anything else is selected, I get an "unable to cast object of type 'System.String' to type 'System.Windows.Forms.Control'" error that points to the following statement from the itemcheck event: If Not clb2.Contains(al_2(k).sDate) Then Any insights will be greatly appreciated. ~8th

    Read the article

  • movie does not start in full screen in flash video player

    - by jodeci
    We have this legacy code of a flash video player that functions well enough but still has some loose ends I need to tighten up. It can do the basic "switch to full screen and back to normal size" stunts, however with one exception. On the first fresh load of the app, if I switch to full screen mode first, and then click to play the movie, the player would be in full screen, yet the movie itself would remain in it's original size. //trigger if (stage.displayState == StageDisplayState.NORMAL) { stage.addEventListener('fullScreen', procFullScreen); stage.scaleMode = StageScaleMode.NO_SCALE; stage.displayState = StageDisplayState.FULL_SCREEN; //mv:VideoDisplay mv.percentHeight = 100; mv.percentWidth = 100; mv.x = 0; mv.y = 0; } // event handler if (event.fullScreen) { mv.smoothing = true; this.height = stage.height; this.width = stage.width; //videoCanvas:Canvas videoCanvas.height = Application.application.height; videoCanvas.width = Application.application.width; fullScreenViewStack.selectedIndex = 1; } The VideoDisplay object even returns the expected width/height, but the movie just plays in it's original size. If I switch screen sizes during movie playback, then the movie size will shrink or stretch as it should. I'm running out of ideas, any suggestions? Thanks in advance!

    Read the article

  • Force a view change from a button when using UITabBarController

    - by user342197
    Hello - When using a UITabBarController, when the user enters some data on View1 and presses a button, I need to perform some calculations and present the results on View2. I have an AppDelegate, View1Controller, View2Controller, and View3Controller (View3 is a basically static view). My AppDelgate declares UITabBarController *rootController; On View1, I have the calculations being performed in an IBAction for buttonPressed; however, I can't seem to force the view to switch to View2 programmatically. I have done a lot of searching for similar problems, and think I should be doing something like "self.rootController.selectedIndex = 1"; however,when I do this from within buttonPressed on my View1Controller, I get an error "request for member rootController in something not in a structure or union". I think I'm missing something basic here... probably need do do something with my AppDelegate, but I'm banging my head against the wall. Can anyone provide some guidance in this situation...like key things I should do in View1Controller header and implementation with reference to my AppDelgate? Thank you!

    Read the article

  • Adding select menu default value via JS?

    - by purpler
    Hi, i'm developing a meta search engine website, Soogle and i've used JS to populate select menu.. Now, after the page is loaded none of engines is loaded by default, user needs to select it on his own or [TAB] to it.. Is there a possibility to preselect one value from the menu via JS after the page loads? This is the code: Javascript: // SEARCH FORM INIT function addOptions(){ var sel=document.searchForm.whichEngine;for(var i=0;i<arr.length;i++){ sel.options[i]=new Option(arr[i][0],i)}} function startSearch(){ searchString=document.searchForm.searchText.value;if(searchString!=""){ var searchEngine=document.searchForm.whichEngine.selectedIndex; var finalSearchString=arr[searchEngine][1]+searchString;location.href=finalSearchString}return false} function checkKey(e){ var character=(e.which)?e.which:event.keyCode;if(character=='13'){ return startSearch()}} // SEARCH ENGINES INIT var arr = new Array(); arr[arr.length] = new Array("Web", "http://www.google.com/search?q="); arr[arr.length] = new Array("Images", "http://images.google.com/images?q="); arr[arr.length] = new Array("Knoweledge","http://en.wikipedia.org/wiki/Special:Search?search="); arr[arr.length] = new Array("Videos","http://www.youtube.com/results?search_query="); arr[arr.length] = new Array("Movies", "http://www.imdb.com/find?q="); arr[arr.length] = new Array("Torrents", "http://thepiratebay.org/search/"); HTML: <body onload="addOptions();document.forms.searchForm.searchText.focus()"> <div id="wrapper"> <div id="logo"></div> <form name="searchForm" method="POST" action="javascript:void(0)"> <input name="searchText" type="text" onkeypress="checkKey(event);"/> <span id="color"></span> <select tabindex="1" name="whichEngine" selected="Web"></select> <br /> <input tabindex="2" type="button" onClick="return startSearch()" value="Search"/> </form> </div> </body>

    Read the article

  • onchange event of select box

    - by Priyanka
    I am using a selectbox to display the list of "enterpirses" from the database. But the onchange event is not triggering. But when i manually once put the value of querystring then it starts working. I dont understand why it is happening. I am new to javascript and php, kindly suggest me the solution to this. <select id="enterprisebox" onchange="javascript:valueselect()" > <option value="-">-</option> <?php foreach($enterprise as $val) { ?> <option value="<?php echo $val['customer_id'];?>"><?php echo $val['customer_name']?> </option> <? } ?> </select> and my javascript is-- function valueselect() { var i = document.getElementById('enterprisebox'); var p = i.options[i.selectedIndex].value; //alert(p); window.location.href = "channelinformation.html?selected="+p; }

    Read the article

  • Hide/Show Text Field based on Selected value - ROR

    - by Tau
    I am new to ROR. I am trying to show a "Others" text field only if the selected value is "others". I am trying to make hide/show function to be as general as possible, since I will need it in many controller. If anyone can help enlightening me, I will really appreciate it. BTW, I am using Rails 2.1.1 ruby 1.8.7 general_info.html.erb <div> <%= f.label :location_id, "Location:" %> <%= f.collection_select(:location_id, Event.locations, :id, :name, {:prompt => true}, {:onchange => remote_function( :url => {:action => "showHideDOMOther"}, :with => "'selectedText='+this.options[this.selectedIndex].text + '&other_div='+'loc_other'")}) %> </div> <div id="loc_other" style="display:none"> <%= f.label :location_others, "Others:" %> <%= f.text_field :location_others %> </div> info_controller.rb def showHideDomOther render :update do |page| page.showHideDOM("Others", params[:selectedText], params[:other_div]) end end ... application_helper.rb def showHideDOM(targetString, selectedText, targetDiv) if selectedText.casecmp targetString page.hide targetDiv else page.show targetDiv end end Seem to get the correct parameters value, but nothing seems to happen. This is what I see from the console when I changed the value of selection to "Others". Parameters: {"action"=>"showHideDOMOther", "authenticity_token"=>"e7da7ce4631480b482e29da9c0fde4c026a7a70d", "other_div"=>"loc_other", "controller"=>"events", "selectedText"=>"Others"} NoMethodError (undefined method search_generic_view_paths?' for #<EventsController:0xa41c720>): /vendor/plugins/active_scaffold/lib/extensions/generic_view_paths.rb:40:infind_template_extension_from_handler' C:/usr/lib/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/template_finder.rb:138:in pick_template_extension' C:/usr/lib/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/template_finder.rb:115:infile_exists?' : Rendering C:/usr/lib/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/templates/rescues/layout.erb (internal_server_error)

    Read the article

  • im unable to validate a login of users ,since if im entering the wrong values my datareader is not getting executed y ?

    - by Salman_Khan
    //code private void glassButton1_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox1.Text == "" || comboBox1.SelectedIndex == 0) { Message m = new Message(); m.ShowDialog(); } else { try { con.ConnectionString = "Data source=BLACK-PEARL;Initial Catalog=LIFELINE ;User id =sa; password=143"; con.Open(); SqlCommand cmd = new SqlCommand("Select LoginID,Password,Department from Login where LoginID=@loginID and Password=@Password and Department=@Department", con); cmd.Parameters.Add(new SqlParameter("@loginID", textBox1.Text)); cmd.Parameters.Add(new SqlParameter("@Password", textBox2.Text)); cmd.Parameters.Add(new SqlParameter("@Department", comboBox1.Text)); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { string Strname = dr[0].ToString(); string StrPass = dr[1].ToString(); string StrDept = dr[2].ToString(); if(dr[2].ToString().Equals(comboBox1.Text)&&dr[0].ToString().Equals(textBox1.Text)&&dr[1].ToString().Equals(textBox2.Text)) { MessageBox.Show("Welcome"); } else { MessageBox.Show("Please Enter correct details"); } } dr.Close(); } catch (Exception ex) { MessageBox.Show("Exception" + ex); } finally { con.Close(); } } }

    Read the article

  • Cant insert a object into a silverlight databound combo box

    - by Steve
    Hi Until recently I had a combo box that was bound to a Linq queried IEnumerable of a DataService.Obj type in the bind method, and all worked fine private IEnumerable<DataService.Obj> _GeneralList; private IEnumerable<DataService.Obj> _QueriedList; private void Bind() { _GeneralList = SharedLists.GeneralList; _QueriedList = _GeneralList.Where(q =>q.ID >1000); cmbobox.ItemsSource = _QueriedList; } Then I had to change the method to insert a new obj and set that object as the default obj and now I get a "System.NullReferenceException: Object reference not set to an instance of an object" exception. I know this has to do with inserting into a linq queried ienumerable but I cant fix it. Any help will be gratefully received. private IEnumerable<DataService.Obj> _GeneralList; private IEnumerable<DataService.Obj> _QueriedList; private void Bind() { _GeneralList = SharedLists.GeneralList; _QueriedList = _GeneralList.Where(q =>q.ID >1000); cmbobox.ItemsSource = _QueriedList; DataService.Obj info = new DataService.Obj(); info.ID = "0"; (cmbobox.ItemsSource as ObservableCollection<DataService.Obj>).Insert(0,info); cmbobox.SelectedIndex = 0; } Thanks in advance

    Read the article

  • Flex: Method doesn't work when being called on parentDocument

    - by ChrisInCambo
    Hi, I wonder is anyone can look at this code and tell me why calling the removeSelectedChild works when called from the same document, but returns the following error when called from the child document/component. "ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller." <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > <mx:Accordion id="myAccordion" width="100%" height="100%" selectedIndex="0"> <mx:Script> <![CDATA[ public function removeSelectedChild():void { myAccordion.removeChild(myAccordion.selectedChild); } ]]> </mx:Script> <mx:headerRenderer> <mx:Component> <mx:Button click="{ parentDocument.removeSelectedChild() }" /> </mx:Component> </mx:headerRenderer> <mx:HBox> <mx:Button click="{ removeSelectedChild() }" /> </mx:HBox> </mx:Accordion> </mx:Application> Clicking on the button in the child produces the expected result, whilst clicking on the header throws an error despite the fact they both call exactly the same method. Sorry that the example is a little contrived, this problem arose in a quite complicated view, which was using all kinds of custom components. This was the only way I could display it in a way that will be quick for you to compile and easy to focus on the real issue without background noise. I'm pulling my hair out on this one and would really appreciate it if anyone could help. Cheers, Chris

    Read the article

  • Flex customized Horizental List

    - by muzammal
    i have customized Horizontal List (items are image and some text) of a reel with some no of clips . i have customized highlight , un highlight and select style , which will be implemented dynamically and mouse over and out. now pproblem is to make un highlight previously playing clip. enter code here styleName="unhighlightedClip" updateComplete="currentlyPlaying();" rollOver="highlighted();" rollOut="unhighlighted();" .currentlyPlayingClip{ borderColor: #95123E; borderStyle: solid; borderThickness: 2; } .unhighlightedClip{ borderStyle: none; } .highlightedClip{ borderColor: #70BAE7; borderStyle: solid; borderThickness: 2; } </mx:Style> <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.controls.HorizontalList; private var prevIndex:int = -1; protected function unhighlighted():void{ var selected:Boolean = HorizontalList(this.owner).isItemSelected(this.data); clipDesription.useHandCursor = false; clipStartTime.useHandCursor = false; this.useHandCursor = false; if(!selected) this.setStyle('styleName', 'unhighlightedClip'); } protected function highlighted():void{ clipDesription.useHandCursor = true; clipStartTime.useHandCursor = true; this.useHandCursor = true; var selected:Boolean = HorizontalList(this.owner).isItemSelected(this.data); if(!selected) this.setStyle('styleName', 'highlightedClip'); } protected function currentlyPlaying():void{ var selected:Boolean = HorizontalList(this.owner).isItemSelected(this.data); var currentIndex:int = HorizontalList(this.owner).selectedIndex; if(selected) this.setStyle('styleName', 'currentlyPlayingClip'); // else if(prevIndex != currentIndex ) // this.setStyle('styleName', 'unhighlightedClip'); // // prevIndex = currentIndex; } ]]

    Read the article

  • getting an onclick event to a select option using js

    - by Vadim.G
    i am having a very frustrating problem. I have this code which filters out my results and inputs them into a select box var syn = <?=json_encode($syn)?>; function filterByCity() { var e = document.getElementById("city_filter"); var city = e.options[e.selectedIndex].value; var selectOptions = document.getElementById('syn_list'); selectOptions.options.length = 0; for (i = 0; i < syn.length; i++) { if (city == syn[i]['city'] || city == 'all') { selectOptions.options[selectOptions.options.length] = new Option(syn[i]['name'], syn[i]['id'] + '" onclick="updateTxtContent(\'' + syn[i]['id'] + '\')'); } } } as you might see i am adding a onclick listener to every select "option" which look great in the source code of the page itself but if i copy it into an edit i notice this my problem is that the "updateTxtContent()" function is not called. <select size="10" name="syn_list" id="syn_list" class="span12" dir="rtl" style="text-align:right;"> <option value="13&quot; onclick=&quot;updateTxtContent('13')">option a</option> <option value="14&quot; onclick=&quot;updateTxtContent('14')">option b</option> obviously there should be a better way to do this that i am not aware of.

    Read the article

  • Android CursorAdapters, ListViews and background threads

    - by MattC
    This application I've been working on has databases with multiple megabytes of data to sift through. A lot of the activities are just ListViews descending through various levels of data within the databases until we reach "documents", which is just HTML to be pulled from the DB(s) and displayed on the phone. The issue I am having is that some of these activities need to have the ability to search through the databases by capturing keystrokes and re-running the query with a "like %blah%" in it. This works reasonably quickly except when the user is first loading the data and when the user first enters a keystroke. I am using a ResourceCursorAdapter and I am generating the cursor in a background thread, but in order to do a listAdapter.changeCursor(), I have to use a Handler to post it to the main UI thread. This particular call is then freezing the UI thread just long enough to bring up the dreaded ANR dialog. I'm curious how I can offload this to a background thread totally so the user interface remains responsive and we don't have ANR dialogs popping up. Just for full disclosure, I was originally returning an ArrayList of custom model objects and using an ArrayAdapter, but (understandably) the customer pointed out it was bad memory-manangement and I wasn't happy with the performance anyways. I'd really like to avoid a solution where I'm generating huge lists of objects and then doing a listAdapter.notifyDataSetChanged/Invalidated() Here is the code in question: private Runnable filterDrugListRunnable = new Runnable() { public void run() { if (filterLock.tryLock() == false) return; cur = ActivityUtils.getIndexItemCursor(DrugListActivity.this); if (cur == null || forceRefresh == true) { cur = docDb.getItemCursor(selectedIndex.getIndexId(), filter); ActivityUtils.setIndexItemCursor(DrugListActivity.this, cur); forceRefresh = false; } updateHandler.post(new Runnable() { public void run() { listAdapter.changeCursor(cur); } }); filterLock.unlock(); updateHandler.post(hideProgressRunnable); updateHandler.post(updateListRunnable); } };

    Read the article

  • how to concatinate a link with <select> <option> value on "onchange" event

    - by atif
    <?php echo $this->getUrl(); ?> = this gives me my index page url .i.e. www.domain.com/index.php/ but now wat i want is when any particular option is selected, it should add to this url. .e.g. www.domain.com/index.php/wordpress/ i write this code for it but now don know how to get it done :( <select onchange="setLocation('<?php echo $this->getUrl(); ?>')"> <option value="">&nbsp;</option> <option value="wordpress">Wordpress</option> <option value="drupal">drupal</option> <option value="magento">Megento</option> </select> also i had searched this link but couldn't take help from it. As it didnt work for me. <select name="forma" ONCHANGE="location = this.options[this.selectedIndex].value;"> <option value="Home">Home</option> <option value="Contact">Contact</option> <option value="Sitemap">Sitemap</option> </select>

    Read the article

  • Populate table fields on query execution

    - by Jason
    I'm trying to build an ASP site that populates a Table based on the results of a selection in a ListBox. In order to do this, I've created a GridView table inside a div element. Currently the default behavior is to show all the items in the specified table in sortable order. However, I'd like to refine this further to allow for display of matches based on the results from the ListBox selection, but am not sure how to execute this. The ListBox fires off a OnSelectionChanged event to the method defined below and the GridView element is defined as <asp:GridView ID="dataListings" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="LinqDataSource1" OnDataBinding="ListBox1_SelectedIndexChanged"> protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e) { int itemSelected = selectTopics.SelectedIndex; string[] listing = null; switch (itemSelected)//assign listing the array of course numbers { case 0: break; case 1: listing = arts; break; case 2: listing = currentEvents; break; .... More cases here default: listing = arts; break; } using (OLLIDBDataContext odb = new OLLIDBDataContext()) { var q = from c in odb.tbl_CoursesAndWorkshops where listing.Contains(c.tbl_Course_Description.tbl_CoursesAndWorkshops.course_workshop_number) select c; dataListings.DataSource = q; dataListings.DataBind(); } } However, this method never gets fired. I can see a request being made when changing the selection, but setting a breakpoint at the method declaration does nothing at all. Based on this, setup, I have three related questions What do I need to modify to get the OnSelectionChanged event handler to fire? How can I alter the GridView area to be empty on page load? How do I send the results from the dataListings.DataBind() execution to show in the GridView?

    Read the article

  • validation controls are not validating on enabling on client side using java script, plz guide

    - by haansi
    Hi, As per requirement I disabled all validation controls in page on PageLoad event in server side. On clicking submit button I want to activate them and validate the page and if the page is ok submit other wise not. I am able to enable all validaters but one thing that I am unable to understand is that they do not validate the page. I set alerts and check they are being enabled but they do not validate the page and let the page submit. I am sorry I couldn't get where I am wrong, may be there need to call some validation method as well or I should prevent default behavior of button. please guide me. Below is my script: <script type="text/javascript"> function NextClicked() { var _ddlStatus = document.getElementById("<%=ddlEmpStatus.ClientID%>"); var _selectedIndex = _ddlStatus.selectedIndex; if (_selectedIndex == 0) { alert("Nothing selected"); }<br/> else<br/> if (_selectedIndex == 1) { for (i = 0; i < Page_Validators.length; i++) { Page_Validators[i].Enabled = true; } } } </script> thanks in anticipation.

    Read the article

  • Assigning values to the lable through database depending on listbox values

    - by SurajVitekar
    I want to assign the values of five labels from database regarding to values selected in listbox. The db query returns single column with multiple records. Please help. I'm working with C# 2010 and MS SQL. My current code is: private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { try { String c1, c2; c1 = "NULL"; MessageBox.Show("LB index :"+listBox1.SelectedIndex.ToString()); //p = listBox1.SelectedItem.ToString(); SqlConnection con = new SqlConnection(); con.ConnectionString = "Data Source=localhost;Initial Catalog=eVoting;Integrated Security=True;Pooling=False"; con.Open(); MessageBox.Show("List bOx sect :"+listBox1.SelectedValue.ToString()); SqlCommand cmd = new SqlCommand("select Firstname from candidates where position ='" + listBox1.SelectedValue.ToString() + "'", con); int index = 0; SqlDataReader reader = cmd.ExecuteReader(); while(reader.Read()) { if (index == 0) { c1 = reader[index].ToString(); radioButton1.Text = c1; } if (index == 1) { c1 = reader[index].ToString(); radioButton2.Text = c1; } if (index == 2) { c1 = reader[index].ToString(); radioButton3.Text = c1; } if (index == 3) { c1 = reader[index].ToString(); radioButton4.Text = c1; } if (index == 4) { c1 = reader[index].ToString(); radioButton4.Text = c1; } if (index == 5) { c1 = reader[index].ToString(); radioButton5.Text = c1; } MessageBox.Show("c1 :" + c1); index++; } } catch (Exception E) { } }

    Read the article

  • ViewController behaving oddly when pushed on the window

    - by ayazalavi
    I am using multiple controller during launch of an application in app delegate. One controller is for registration and the second controller is tabbar. tabbar was loading fine but when I pushed registration controller on window, contents went up by 20 units and I have good white blank screen at bottom. Therefore I recreated frame of my registration view controller in its viewdidload method and slided it 20 units down. The code is self.view.frame = CGRectMake(0, 20, self.view.frame.size.width, self.view.frame.size.height); and code in my app delegate for launch application was - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { if (![self accountExists]) { //code if account does not exists on iphone app database self.registerAccount = [[registerViewController alloc] initWithNibName:@"registerViewController" bundle:nil]; [window addSubview:registerAccount.view]; } else if([self autoLoginForAnyAccount]){ //code for autologin to app } else { self.tabBarController.selectedIndex = 1; self.tabBarController.delegate = self; [window addSubview:tabBarController.view]; } [window makeKeyAndVisible]; return YES; } if anyone knows why there is a white space at bottom when registration controller is pushed then please share it with me.

    Read the article

  • VB.net avoiding cross thread exception with extension method

    - by user574632
    Hello I am trying to implement a solution for updating form controls without using a delegate. I am attempting to use the 1st solution on this page: http://www.dreamincode.net/forums/blog/143/entry-2337-handling-the-dreaded-cross-thread-exception/ Imports System.ComponentModel Imports System.Runtime.CompilerServices Public Module MyInvoke <Extension()> _ Public Sub CustomInvoke(Of T As ISynchronizeInvoke)(ByVal control As T, ByVal toPerform As Action(Of T)) If control.InvokeRequired Then control.Invoke(toPerform, New Object() {control}) toPerform(control) End If End Sub End Module The site gives this as example of how to use: Label1.CustomInvoke(l => l.Text = "Hello World!") But i get 'l' is not declared error. As you can see im very new to VB or any OOP. I can get the second solution on that page to work (using delegates) but i have quite a few things to do in this thread and it seems like i would need to write a new delegate sub for each thing, which seems wasteful. What i need to do is select the 1st item from a combobox, update a textbox.text with the selected item, and pass the selected item to a function. Then wait for x seconds and start again, selecting the second item. I can get it to work in a single threaded application, but i need the interface to remain responsive. Any help greatly appreciated. EDIT: OK so changing the syntax worked for the example. However if i change it from Label1.CustomInvoke(Sub(l) l.text = "hello world!") (which worked just fine) to: Dim indexnumber As Integer = 0 ComboBox1.CustomInvoke(Sub(l) l.SelectedIndex = indexnumber) I get a cross threading error as though i didnt even use this method: Cross-thread operation not valid: Control 'ComboBox1' accessed from a thread other than the thread it was created on. So now im back to where i started? Any further help very much appreciated.

    Read the article

  • jquery problem in IE working fine in FF

    - by Bharanikumar
    function populate_customer_details(){ $.ajax({ type : 'POST', url : 'populate_customer_details.php', data: { email : $('#txt_email_id').val() }, success : function(data){ if(data=="NOROWSFOUND"){ alert("Sorry, Email ID not exist in our database"); document.getElementById("txt_email_id").focus(); }else{ var val = explode_all_into_arr(data,"|=|"); document.getElementById("FirstName").value = val[0]; document.getElementById("LastName").value = val[1]; document.getElementById("mobilecountrycode").value = parseInt(val[2]); document.getElementById("MobileNo").value = val[3]; document.getElementById("homecountrycode").value = parseInt(val[4]); document.getElementById("HomeNo").value = val[5]; document.getElementById("PaxEmail").value = val[6]; document.getElementById("PaxEmailConf").value = val[6]; } }, }); } This is my snippet purpose is getting the customer details and populate into textfield and combo box , That is Firstname will append into Firstname text field , Secondname will append into Secondname text field , Same like mobilecountrycode (but this is dropdown combo), Some time combo selectedindex work fine, but some time not selecting the value , I am not sure what s problem in that... Nothing works in IE , Also showing object expected error in IE , i have ajax_common.js : in this i added above script , in the page top first i included the jquery.js , Then i include ajax_common.js file, But no idea why this problem. Regards (NOTE i included the jquery.js ) ,

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13  | Next Page >