Search Results

Search found 435 results on 18 pages for 'onchange'.

Page 7/18 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • How do you get an asp.net control's auto generated name attribute?

    - by Petras
    I have a DropDownList and need to know its name in the code behind: <select name="ctl00$cphMainContent$ddlTopic" onchange="javascript:setTimeout('__doPostBack(\'ctl00$cphMainContent$ddlTopic\',\'\')', 0)" id="ctl00_cphMainContent_ddlTopic"> <option value="All">All</option> </select> I need to get the value "ctl00$cphMainContent$ddlTopic" Is that possible?

    Read the article

  • Scriptaculous Sortable.create - Can't hook the dragged element

    - by Tom
    When using Sortable.create I can't seem to get the element that is being dragged. Does Sciptaculous not fully implement all Draggable and Droppable features when you use sortable? Given: Sortable.create("sortArea", {scroll:window, onChange:orderLi}); function orderLi(){ console.log(this.draggables.each(function(e){if(e.dragging==true){return e};})); } My console always shows all the array of draggables. How do I only grab the one that is being dragged?

    Read the article

  • a4j:support within a rich:modalPanel

    - by Andy Deighton
    Hi all, I've hit a wall. I know the a4j and rich tags pretty well (I use Seam 2.2.0 and Richfaces 3.3.1). However, I'm trying to do something quite simple, but in a rich:modalPanel. It seems that rich:modalPanels do not allow Ajax events to be fired. Here's a simple breakdown: I have a h:selectOneMenu with some items in it and whose value is attached to a backing bean. Attached to that h:selectOneMenu is a a4j:support tag so that whenever the change event is fired, the backing bean should get updated. Truly simple stuff eh? However, when this h:selectOneMenu is in a rich:modalPanel the onchange event doesn't update the backing bean until the rich:modalPanel closes. I can confirm this because I'm running it in Eclipse debug mode and I have a breakpoint on the setter of the property that's hooked up to the h:selectOneMenu. This is driving me mad! This is vanilla stuff for Ajax, but rich:modalPanels don't seem to allow it. So, the question is: can I do Ajax stuff within a rich:modalPanel? I'm basically trying to use the rich:modalPanel as a form (I've tried a4j:form and h:form to no avail) that reacts to changes to the drop down (e.g. when the user changes the drop down, a certain part of the form should get reRendered). Am I trying to do something that's not possible? Here's a simplified version of the modalPanel: <rich:modalPanel id="quickAddPanel"> <div> <a4j:form id="quickAddPaymentForm" ajaxSubmit="true"> <s:decorate id="paymentTypeDecorator"> <a4j:region> <h:selectOneMenu id="paymentType" required="true" value="#{backingBean.paymentType}" tabindex="1"> <s:selectItems label="#{type.description}" noSelectionLabel="Please select..." value="#{incomingPaymentTypes}" var="type"/> <s:convertEnum/> <a4j:support ajaxSingle="true" event="onchange" eventsQueue="paymentQueue" immediate="true" limitToList="true" reRender="paymentTypeDecorator, paymentDetailsOutputPanel, quickAddPaymentForm"/> </h:selectOneMenu> </a4j:region> </s:decorate> </fieldset> <fieldset class="standard-form"> <div class="form-title">Payment details</div> <a4j:outputPanel id="paymentDetailsOutputPanel"> <h:outputText value="This should change whenever dropdown changes: #{backingBean.paymentType}"/> </a4j:outputPanel> </fieldset> </a4j:form> </div> </rich:modalPanel> Regards, Andy

    Read the article

  • Backslash in JavaScript

    - by erasmus
    In my javascript code I have onchange="document.getElementById('user_name').value = document.getElementById('theDomain').value + '\\' + document.getElementById('fake_user_name').value" here backslash doesn't work. What is the problem? How should I write it?

    Read the article

  • How do you replace content without losing focus?

    - by Ryan
    For example: <input type="text" name="test" onChange="document.formname.test.value=.document.formname.test.value.replace('something','something else')" /> The replace function works but it loses focus on every change How do you make it not lose focus? What I'm trying to do is make it so that certain text is immediately replaced with new text when its typed but you can continue typing

    Read the article

  • How to override loading a TImage from the object inspector (at run-time)?

    - by Mawg
    Further to my previous question, which did not get a useful answer despite a bounty, I will try rephrasing the question. Basically, when the user clicks the ellipsis in the object inspector, Delphi opens a file/open dialog. I want to replace this handling with my own, so that I can save the image's path. I would have expected that all I need to do is to derive a class from TImage and override the Assign() function, as in the following code. However, when I do the assign function is never called. So, it looks like I need to override something else, but what? unit my_Image; interface uses Classes, ExtCtrls, Jpeg, Graphics; type Tmy_Image = class(Timage) private FPicture : TPicture; protected procedure OnChange(Sender: TObject); public { Public declarations } Constructor Create(AOwner: TComponent); override; procedure SetPicture(picture : TPicture); procedure Assign(Source: TPersistent); override; published { Published declarations - available in the Object Inspector at design-time } property Picture : TPicture read FPicture write SetPicture; end; // of class Tmy_Image() procedure Register; implementation uses Controls, Dialogs; procedure Register; begin RegisterComponents('Standard', [Tmy_Image]); end; Constructor Tmy_Image.Create(AOwner: TComponent); begin inherited; // Call the parent Create method Hint := 'Add an image from a file|Add an image from a file'; // Tooltip | status bar text AutoSize := True; // Control resizes when contents change (new image is loaded) Height := 104; Width := 104; FPicture := TPicture.Create(); self.Picture.Bitmap.LoadFromResourceName(hInstance, 'picture_poperty_bmp'); end; procedure Tmy_Image.OnChange(Sender: TObject); begin Constraints.MaxHeight := Picture.Height; Constraints.MaxWidth := Picture.Width; Self.Height := Picture.Height; Self.Width := Picture.Width; end; procedure Tmy_Image.SetPicture(picture : TPicture); begin MessageDlg('Tmy_Image.SetPicture', mtWarning, [mbOK], 0); // never called end; procedure Tmy_Image.Assign(Source: TPersistent); begin MessageDlg('Tmy_Image.Assign', mtWarning, [mbOK], 0); // never called end; end.

    Read the article

  • Post data to MVC3 controller without pagerefresh

    - by Smooth
    I have this script that basically has 4 select boxes, what I want is that for the 2 top select boxes, he submits the optionvalue that is selected to an action (which can be found at "ProductKoppeling/ProductKoppelingPartial"), I want to let him submit this data when I click on an option but without page refresh. I tried JSON and I tried Ajax, but I didn't get it working.. How should i do this? <script language="javascript" type="text/javascript"> function delete_1() { var answer = confirm("U staat op het punt dit product te verwijderen, wilt u doorgaan?") if (answer) { document.getElementById('Actie_1').value = '5'; document.getElementById('hpg_submit').submit(); } } function delete_2() { var answer = confirm("U staat op het punt dit product te verwijderen, wilt u doorgaan?") if (answer) { document.getElementById('Actie_2').value = '6'; document.getElementById('pg_submit').submit(); } } function delete_3() { var answer = confirm("U staat op het punt dit product te verwijderen, wilt u doorgaan?") if (answer) { document.getElementById('Actie_3').value = '6'; document.getElementById('p_submit').submit(); } } </script> <div style="width: 500px; float: left;"> @using (Html.BeginForm("ProductKoppelingPartial", "ProductKoppeling", FormMethod.Post, new { id = "onload_submit" })) { @Html.DropDownList("Klant.Id", (ViewBag.Klant as SelectList), new { onchange = "document.getElementById('onload_submit').submit()" }) } <div style="clear: both"></div> <div style="float: left;"> <b>Hoofdgroepen</b><br /> @using (Html.BeginForm("ProductKoppelingPartial", "ProductKoppeling", FormMethod.Post, new { id = "hpg_submit" })) { if (ViewBag.SelectedKlant != null) { <input type="hidden" name="Klant.Id" value="@ViewBag.SelectedKlant.Id" /> } <select style="width: 200px;" size="6" id="HoofdProductGroep" name="HoofdProductGroep.Id" onchange="document.getElementById('hpg_submit').submit();"> @foreach (var hpg in ViewBag.HoofdProductGroep) { if (ViewBag.SelectedHPG != null) { if (hpg.Id == ViewBag.SelectedHPG.Id) { <option value="@hpg.Id" selected="selected">@hpg.Naam</option> } else { <option value="@hpg.Id">@hpg.Naam</option> } } else { <option value="@hpg.Id">@hpg.Naam</option> } } </select> <input type="hidden" name="Actie" id="Actie_1" value="0" /> <br /> <img src="../../Content/toevoegen.png" style="cursor: pointer; width: 30px;" onclick="document.getElementById('Actie_1').value='1';document.getElementById('hpg_submit').submit();" /> <img src="../../Content/bewerken.png" style="cursor: pointer; float: none; width: 30px;" onclick="document.getElementById('Actie_1').value='2';document.getElementById('hpg_submit').submit();" /> <img src="../../Content/verwijderen.png" style="cursor: pointer; float: none; width: 30px;" onclick="delete_1()" /> } </div> <div style="float: right;"> <b>Groepen</b><br /> @using (Html.BeginForm("ProductKoppelingPartial", "ProductKoppeling", FormMethod.Post, new { id = "pg_submit" })) { if (ViewBag.SelectedHPG != null) { <input type="hidden" name="HoofdProductGroep.Id" value="@ViewBag.SelectedHPG.Id" /> } if (ViewBag.SelectedKlant != null) { <input type="hidden" name="Klant.Id" value="@ViewBag.SelectedKlant.Id" /> } <select size="6" style="width: 200px;" id="ProductGroep_Id" name="ProductGroep.Id" onchange="document.getElementById('pg_submit').submit();"> @foreach (var pg in ViewBag.ProductGroep) { if (ViewBag.SelectedPG != null) { if (pg.Id == ViewBag.SelectedPG.Id) { <option value="@pg.Id" selected="selected">@pg.Naam</option> } else { <option value="@pg.Id">@pg.Naam</option> } } else { <option value="@pg.Id">@pg.Naam</option> } } </select> <input type="hidden" name="Actie" id="Actie_2" value="0" /> <br /> <img src="../../Content/toevoegen.png" style="cursor: pointer; width: 30px;" onclick="document.getElementById('Actie_2').value='3';document.getElementById('pg_submit').submit();" /> <img src="../../Content/bewerken.png" style="cursor: pointer; float: none; width: 30px;" onclick="document.getElementById('Actie_2').value='4';document.getElementById('pg_submit').submit();" /> <img src="../../Content/verwijderen.png" style="cursor: pointer; float: none; width: 30px;" onclick="delete_2()" /> } </div> <div style="clear: both; height: 25px;"></div> @using (Html.BeginForm("Save", "ProductKoppeling", FormMethod.Post, new { id = "p_submit" })) { <div style="float: left"> <b>Producten</b><br /> <select size="18" style="width: 200px;" name="Product.Id"> @foreach (var p in ViewBag.Product) { <option value="@p.Id">@p.Naam</option> } </select> @if (ViewBag.SelectedPG != null) { if (ViewBag.SelectedPG.Id != null) { <input type="hidden" name="ProductGroep.Id" value="@ViewBag.SelectedPG.Id" /> } } <input type="hidden" name="Actie" id="Actie_3" value="0" /> <br /> <img src="../../Content/toevoegen.png" style="cursor: pointer; width: 30px;" onclick="document.getElementById('Actie_3').value='1';document.getElementById('p_submit').submit();" /> <img src="../../Content/bewerken.png" style="cursor: pointer; float: none; width: 30px;" onclick="document.getElementById('Actie_3').value='2';document.getElementById('p_submit').submit();" /> <img src="../../Content/verwijderen.png" style="cursor: pointer; float: none; width: 30px;" onclick="delete_3()" /> <br /> </div> <div style="float: left; width: 100px;"> <center> <br /><br /><br /><br /> <a style="cursor: pointer; float: none; color: blue; font-size: 30px;" onclick="document.getElementById('p_submit').submit();">»</a> <br /><br /><br /><br /><br /><br /><br /><br /><br /> <a style="cursor: pointer; float: none; color: blue; font-size: 30px;" onclick="document.getElementById('pgp_submit').submit();">«</a> </center> </div> } <div style="float: right;"> <b>Producten in groepen</b><br /> @using (Html.BeginForm("Delete", "ProductKoppeling", FormMethod.Post, new { id = "pgp_submit" })) { <select size="18" style="width: 200px;" name="ProductGroepProduct.Id"> @foreach (var pgp in ViewBag.ProductGroepProduct) { if (pgp != null) { if (pgp.Product != null) { <option value="@pgp.Id">@pgp.Product.Naam</option> } } } </select> } </div>

    Read the article

  • Programmatically triggering events in Javascript for IE using jQuery

    - by Dan Herbert
    When an Event is triggered by a user in IE, it is set to the window.event object. The only way to see what triggered the event is by accessing the window.event object (as far as I know) This causes a problem in ASP.NET validators if an event is triggered programmatically, like when triggering an event through jQuery. In this case, the window.event object stores the last user-triggered event. When the onchange event is fired programmatically for a text box that has an ASP.NET validator attached to it, the validation breaks because it is looking at the element that fired last event, which is not the element the validator is for. Does anyone know a way around this? It seems like a problem that is solvable, but from looking online, most people just find ways to ignore the problem instead of solving it. To explain what I'm doing specifically: I'm using a jQuery time picker plugin on a text box that also has 2 ASP.NET validators associated with it. When the time is changed, I'm using an update panel to post back to the server to do some things dynamically, so I need the onchange event to fire in order to trigger the postback for that text box. The jQuery time picker operates by creating a hidden unordered list that is made visible when the text box is clicked. When one of the list items is clicked, the "change" event is fired programmatically for the text box through jQuery's change() method. Because the trigger for the event was a list item, IE sees the list item as the source of the event, not the text box, like it should. I'm not too concerned with this ASP.NET validator working as soon as the text box is changed, I just need the "change" event to be processed so my postback event is called for the text box. The problem is that the validator throws an exception in IE which stops any event from being triggered. Firefox (and I assume other browsers) don't have this issue. Only IE due to the different event model. Has anyone encountered this and seen how to fix it? I've found this problem reported several other places, but they offer no solutions: jQuery's forum, with the jQuery UI Datepicker and an ASP.NET Validator ASP.NET forums, bug with ValidatorOnChange() function

    Read the article

  • HtmlHelperExtensions are not visible in view mvc3 asp.net

    - by user1299372
    I've added a class for the HTML Custom Extensions: using System; using System.Linq.Expressions; using System.Text; using System.Web.Mvc; using System.Web.Mvc.Html; namespace App.MvcHtmlHelpers { public static class HtmlHelperExtensions { public static MvcHtmlString ComboBox(HtmlHelper html, string name, SelectList items, string selectedValue) { var sb = new StringBuilder(); sb.Append(html.DropDownList(name + "_hidden", items, new { @style = "width: 200px;", @onchange = "$('input#" + name + "').val($(this).val());" })); sb.Append(html.TextBox(name, selectedValue, new { @style = "margin-left: -199px; width: 179px; height: 1.2em; border: 0;" })); return MvcHtmlString.Create(sb.ToString()); } public static MvcHtmlString ComboBoxFor<TModel, TProperty>(HtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, SelectList items) { var me = (MemberExpression)expression.Body; var name = me.Member.Name; var sb = new StringBuilder(); sb.Append(html.DropDownList(name + "_hidden", items, new { @style = "width: 200px;", @onchange = "$('input#" + name + "').val($(this).val());" })); sb.Append(html.TextBoxFor(expression, new { @style = "margin-left: -199px; width: 179px; height: 1.2em; border: 0;" })); return MvcHtmlString.Create(sb.ToString()); } I've also registered it in my site web config: <namespaces> <add namespace="System.Web.Helpers" /> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> <add namespace="System.Web.WebPages" /> <add namespace="App.MvcHtmlHelpers"/> </namespaces> In my view, I import the namespace: <%@ Import Namespace="RSPWebApp.MvcHtmlHelpers" %> But when I go to call it in the view, it doesn't recognize the custom extension. Can someone help me by telling me what I might have missed? Thanks so much in advance! <%:Html.ComboBoxFor(a => a.Street2, streetAddressListItems) %

    Read the article

  • fieldWithErrors not wrapping every error field

    - by Teef L
    Notice the following result when I submit blank :title and :description fields The validations are in the controller: class Question < ActiveRecord::Base validates_presence_of :title validates_presence_of :description And, the form is generated with those names: -form_for(@question) do |f| = f.error_messages = f.label :title = f.text_field :title, :size => 50, :onchange => remote_function(:url => {:action => :display_tag_suggestions}, :with => 'Form.Element.serialize(this)') #suggestions = f.label :description = f.text_area :description ... But, for some reason, only :title gets wrapped in the error div tags: <form action="/questions" class="new_question" id="new_question" method="post"> <div style="margin:0;padding:0"><input name="authenticity_token" type="hidden" value="6HQaiu1D0gBQcKw2pLeZP6Jvn0FSClPD5Sk9HwegzPg=" /></div> <div class="errorExplanation" id="errorExplanation"> <h2>2 errors prohibited this question from being saved</h2> <p>There were problems with the following fields:</p> <ul> <li>Title can't be blank</li> <li>Description can't be blank</li> </ul> </div> <label for="question_title">Title</label> <div class="fieldWithErrors"><input id="question_title" name="question[title]" onchange="new Ajax.Request('/questions/display_tag_suggestions', {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize(this) + '&amp;authenticity_token=' + encodeURIComponent('6HQaiu1D0gBQcKw2pLeZP6Jvn0FSClPD5Sk9HwegzPg=')})" size="50" type="text" value="" /></div> <label for="question_description">Description</label> <textarea cols="40" id="question_description" name="question[description]" rows="20"></textarea> ... I don't think that behavior is expected. The problem most people have is that it's wrapping things with divs, which won't display properly. My problem is that fields aren't being wrapped with divs to begin with! I haven't made any (conscious) changes to how errors are handled, so I'm not sure why it's not working properly.

    Read the article

  • How to change h:outputText value by JavaScript?

    - by Peter
    I already tested with 2 inputText, It runs well for example var tdate = document.getElementById('txtDate'); //h:inputText var tdt = document.getElementById('txtDateTime'); //h:inputText tdate.onchange = function(){ tdt.value = tdate.value; }; How can I change the value of " tdt " - h:outputText? var tdate = document.getElementById('txtDate'); //h:inputText var tdt = document.getElementById('txtDateTime'); //h:outputText

    Read the article

  • Display all the options if nothing is selected

    - by Levani
    I have four level connected dropdown boxes. I can choose something from second dropdown only after I select something from the first one. The third dropdown is also depended on second one and so on. I need to make selection available in second, third and fourth dropdown, even if there isn't selected anything in previous dropdown, but if the selection is made behave as it behaves now. Am I clear? Here is the code: <table width="100%" border="0" cellspacing="1" cellpadding="4"> <!-- *********************** Countries *********************** --> <tr> <td style="width:150px"><?php if($eaconf->ea_loc_srchtype==0) echo "<b>".JText::_('EA_SRCH_STEP')."</b> 1: ";?><?php echo JText::_('EA_OBJ_COUNTRY'); ?></td> <td > <?php $countrylist[] = JHTML::_('select.option', 'no', JText::_('EA_NOT_SELECTED')); $x=0; foreach($countries as $c){ $countrylist[] = JHTML::_('select.option', $c ,JText::_($countrynames[$x])); $x++; } if($eaconf->ea_loc_srchtype==0){ $countrys['src_country'] = JHTML::_('select.genericlist', $countrylist,'src_country',' class="inputbox" style="width:140px" onChange="setStates(this.selectedIndex-1)"', 'value', 'text','0' ); }else{ $countrys['src_country'] = JHTML::_('select.genericlist', $countrylist,'src_country',' class="inputbox" style="width:140px" ', 'value', 'text','0' ); } ?> <?php echo $countrys['src_country'];?> </td> </tr> <!-- *********************** States *********************** --> <tr> <td ><?php if($eaconf->ea_loc_srchtype==0) echo "<b>".JText::_('EA_SRCH_STEP')."</b> 2: ";?><?php echo JText::_('EA_OBJ_STATE'); ?></td> <td > <?php $statelist[] = JHTML::_('select.option', 'no', JText::_('EA_NOT_SELECTED')); foreach($stateslist as $s){ $statelist[] = JHTML::_('select.option', $s ,JText::_($s)); } if($eaconf->ea_loc_srchtype==0){ $thestates['src_state'] = JHTML::_('select.genericlist', $statelist,'src_state',' class="inputbox" style="width:140px" onChange="setDistricts(this.selectedIndex-1)"', 'value', 'text','0' ); }else{ $thestates['src_state'] = JHTML::_('select.genericlist', $statelist,'src_state',' class="inputbox" style="width:140px" ', 'value', 'text','0' ); } ?> <?php echo $thestates['src_state'];?> </td> </tr> <!-- *********************** Districts ******************** --> <tr> <td > <?php if($eaconf->ea_loc_srchtype==0) echo "<b>".JText::_('EA_SRCH_STEP')."</b> 3: ";?><?php echo JText::_('EA_OBJ_DISTRICT'); ?> </td> <td > <?php $districtlist[] = JHTML::_('select.option', 'no',JText::_('EA_NOT_SELECTED')); foreach($districtslist as $dist){ $districtlist[] = JHTML::_('select.option', $dist ,JText::_($dist)); } if($eaconf->ea_loc_srchtype==0){ $thedistrict['src_district'] = JHTML::_('select.genericlist', $districtlist,'src_district',' class="inputbox" style="width:140px" onChange="setTowns(this.selectedIndex-1)"', 'value', 'text','0' ); }else{ $thedistrict['src_district'] = JHTML::_('select.genericlist', $districtlist,'src_district',' class="inputbox" style="width:140px" ', 'value', 'text','0' ); } ?> <?php echo $thedistrict['src_district'];?> </td> </tr> <!-- *********************** Towns ************************* --> <tr> <td ><?php if($eaconf->ea_loc_srchtype==0) echo "<b>".JText::_('EA_SRCH_STEP')."</b> 4: ";?><?php echo JText::_('EA_OBJ_TOWN'); ?></td> <td > <?php $townlist[] = JHTML::_('select.option', 'no',JText::_('EA_NOT_SELECTED')); foreach($townslist as $town){ $townlist[] = JHTML::_('select.option', $town ,JText::_($town)); } if($eaconf->ea_loc_srchtype==0){ $towns['src_town'] = JHTML::_('select.genericlist', $townlist,'src_town',' class="inputbox" style="width:140px" ', 'value', 'text','0' ); }else{ $towns['src_town'] = JHTML::_('select.genericlist', $townlist,'src_town',' class="inputbox" style="width:140px" ', 'value', 'text','0' ); } ?> <?php echo $towns['src_town'];?> </td> </tr> </table> And the javascript: function setStates(scountry) { sel_state = document.easearch.elements["src_state"]; sel_town = document.easearch.elements["src_town"]; sel_district = document.easearch.elements["src_district"]; empty("src_state"); if(scountry=='no') { new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_state.options.length; sel_state.options[new_opt] = new_entry; sel_state.options[new_opt].value = "no"; sel_state.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; empty("src_district"); new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_district.options.length; sel_district.options[new_opt] = new_entry; sel_district.options[new_opt].value = "no"; sel_district.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; empty("src_town"); new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_town.options.length; sel_town.options[new_opt] = new_entry; sel_town.options[new_opt].value = "no"; sel_town.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; } else{ new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_state.options.length; sel_state.options[new_opt] = new_entry; sel_state.options[new_opt].value = "no"; sel_state.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; for (x=0;x<States[scountry].length;x++ ){ new_entry = new Option(States[scountry][x]); new_opt = sel_state.options.length; sel_state.options[new_opt] = new_entry; sel_state.options[new_opt].value = x; sel_state.options[new_opt].text = States[scountry][x]; } empty("src_district"); new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_district.options.length; sel_district.options[new_opt] = new_entry; sel_district.options[new_opt].value = "no"; sel_district.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; empty("src_town"); new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_town.options.length; sel_town.options[new_opt] = new_entry; sel_town.options[new_opt].value = "no"; sel_town.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; } } function setDistricts(sstate) { scountry = document.easearch.src_country.selectedIndex-1; // sstate = document.easearch.src_state.value; sel_district = document.easearch.elements["src_district"]; empty("src_district"); if(sstate=='no') { new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_district.options.length; sel_district.options[new_opt] = new_entry; sel_district.options[new_opt].value = "no"; sel_district.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; empty("src_town"); new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_town.options.length; sel_town.options[new_opt] = new_entry; sel_town.options[new_opt].value = "no"; sel_town.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; } else{ new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_district.options.length; sel_district.options[new_opt] = new_entry; sel_district.options[new_opt].value = "no"; sel_district.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; for (x=0;x<Districts[scountry][sstate].length;x++ ){ new_entry = new Option(Districts[scountry][sstate][x]); new_opt = sel_district.options.length; sel_district.options[new_opt] = new_entry; sel_district.options[new_opt].value = x; sel_district.options[new_opt].text = Districts[scountry][sstate][x]; } empty("src_town"); new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_town.options.length; sel_town.options[new_opt] = new_entry; sel_town.options[new_opt].value = "no"; sel_town.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; } } function setTowns(sdistrict) { scountry = document.easearch.src_country.selectedIndex-1; sstate = document.easearch.src_state.value; sel_town = document.easearch.elements["src_town"]; sel_district = document.easearch.elements["src_district"]; empty("src_town"); if(sdistrict=='no') { new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_town.options.length; sel_town.options[new_opt] = new_entry; sel_town.options[new_opt].value = "no"; sel_town.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; empty("src_district"); new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_district.options.length; sel_district.options[new_opt] = new_entry; sel_district.options[new_opt].value = "no"; sel_district.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; } else{ new_entry = new Option("<?php echo JText::_('EA_NOT_SELECTED');?>"); new_opt = sel_town.options.length; sel_town.options[new_opt] = new_entry; sel_town.options[new_opt].value = "no"; sel_town.options[new_opt].text = "<?php echo JText::_('EA_NOT_SELECTED');?>"; for (x=0;x<Towns[scountry][sstate][sdistrict].length;x++ ){ new_entry = new Option(Towns[scountry][sstate][sdistrict][x]); new_opt = sel_town.options.length; sel_town.options[new_opt] = new_entry; sel_town.options[new_opt].value = x; sel_town.options[new_opt].text = Towns[scountry][sstate][sdistrict][x]; } } } function empty(field) { document.easearch.elements[field].options.length = 0; }

    Read the article

  • How to Post Javascript to a MySQL Database

    - by salientanimal
    Hi guys, I have created a form in HTLM and I m trying to post the information in the form to a MySQL database. My form make suse of a dynamic list selection that needs to be captured to the database. However when submtting the form I get the following error Error: Unknown column 'coulmn_name' in 'field list'. Here is my HTML CODE for the form <td height="94"><p align="justify">CALL TRACKER - ADMIN</p></td> Customer Name : E-Mail Address : </tr> <tr> <td width="29%" align="right" valign="middle"><strong>Case Number :</strong></td> <td> <input type="text" name="case_number" width="70%" align="left" valign="middle"> </td> </tr> <tr> <td width="29%" align="right" valign="middle"><strong>MSISDN :</strong></td> <td> <input type="text" name="msisdn" width="70%" align="left" valign="middle"> </td> </tr> <tr> <td width="29%" align="right" valign="middle"> <strong>Route Cause :</strong></td> <td width="71%" align="left" valign="middle"> <select name="route_cause" id="category" onChange="javascript: listboxchange1(this.options[this.selectedIndex].value);"> <!-- <select name="route_cause" id="route_cause"> --> <option value="">Select the Call Reason</option> <option value="Billing Admin">Billing Admin</option> <option value="Customer Care">Customer Care</option> <option value="Insurance">Insurance</option> <option value="Repairs">Repairs</option> <option value="SIM Swap">SIM Swap</option> <option value="UTI">UTI</option> </select> </td> </tr> <tr> <td align="right" valign="middle"> <strong>Call Type/Indexed To :</strong></td> <td align="left" valign="middle"> <script type="text/javascript" language="javascript" name="calltype_indexedto"> <!-- document.write('<select name="subcategory1" onChange="javascript: listboxchange2(this.options[this.selectedIndex].value);"><option value=""></option></select>') --> </script> </td> </tr> <tr> <td align="right" valign="middle"> <strong>Type/TAT :</strong></td> <td align="left" valign="middle"> <script type="text/javascript" language="javascript" name="type_tat"> <!-- document.write('<select name="subcategory2" onChange="javascript: listboxchange3(this.options[this.selectedIndex].value);"><option value=""></option></select>') --> </script> </td> </tr> <tr> <td width="29%" align="right" valign="middle"> <strong>Escalated To :</strong></td> <td width="71%" align="left" valign="middle"> <select name="escalatedto" id="escalated_to"> <option value="">Select the Escalation</option> <option value="Billing Ops">Billing Ops</option> <option value="Resolvers">Resolvers</option> <option value="Finance">Finance</option> <option value="Ressolver">Ressolver</option> <option value="Nudebt">Nudebt</option> <option value="Transunion">Transunion</option> <option value="N/A">N/A</option> </select> </td> </tr> <tr> <td width="29%" align="right" valign="middle"> <strong>Requested By :</strong></td> <td width="71%" align="left" valign="middle"> <select name="requestedby" id="requested_by"> <option value="">UTI Requested By</option> <option value="Billing">Billing</option> <option value="Customer Service">Customer Service</option> <option value="Insurance">Insurance</option> <option value="Management">Management</option> <option value="Repairs">Repairs</option> <option value="Retail Support">Retail Support</option> <option value="Retentions">Retentions</option> <option value="SIM Swap">SIM Swap</option> <option value="WOW">WOW</option> <option value="N/A">N/A</option> </select> </td> </tr> <tr> <td width="29%" align="right" valign="middle"> <strong>Province :</strong></td> <td width="71%" align="left" valign="middle"> <select name="province" id="province"> <option value="">Select the Province</option> <option value="Eastern Cape">Eastern Cape</option> <option value="Gauteng">Gauteng</option> <option value="Kwa-Zulu Natal">Kwa-Zulu Natal</option> <option value="Limpopo">Limpopo</option> <option value="Mpumalanga">Mpumalanga</option> <option value="North West">North West</option> <option value="Northern Cape">Northern Cape</option> <option value="Polokwane">Polokwane</option> <option value="Western Cape">Western Cape</option> <option value="Other">Other</option> </select> </td> </tr> <tr> <td width="29%" align="right" valign="middle"><strong>Comments :</strong></td> <td> <textarea rows ="5" cols="30" name="comments"> </textarea> </td> </tr> <tr> <td> <p> <input type="reset" value="Reset Form"><input type="Submit" value="Submit"> Here is my PHP CODE to write to the Database <?php $con = mysql_connect("hostname" ,"mysqusername" ,"mysqlpassword"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("databasename", $con); $sql="INSERT INTO customer_services_tracker (customer_name ,customer_email_address ,case_number ,msisdn ,route_cause ,calltype_indexedto ,type_tat ,escalatedto ,requestedby ,province ,comments ) VALUES ('$_POST[customer_name]' ,'$_POST[customer_email_address]' ,'$_POST[case_number]' ,'$_POST[msisdn]' ,'$_POST[route_cause]' ,'$_POST[calltype_indexedto]' ,'$_POST[type_tat]' ,'$_POST[escalatedto]' ,'$_POST[requestedby]' ,'$_POST[province]' ,'$_POST[comments]')"; $CatName = $rowCat["Name"]; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con) ?>

    Read the article

  • jquery $.getJSON only works once in internet explorer Help Please!!!

    - by JasperS
    I have a php function which inserts a searchbar into each page on a website. The site checks to see if the user has javascript enabled and if they do it inserts some jquery ajax stuff to link select boxes (instead of using it's fallback onchange="form.submit()"). $.getJSON works perfectly for me in other browsers except in IE, if I do a full page refresh (ctrl+F5) in IE my ajax works flawlessly until I navigate to a new page (or the same page with $PHP_SELF) either by submiting the form or clicking a link the jquery onchange function fires but then jquery throws an error: Webpage error details Message: Object doesn't support this property or method Line: 123 Char: 183 Code: 0 URI: http://~#UNABLE~TO~DISCLOSE#~/jquery-1.4.2.min.js It seems like jquery function $.getJSON() is gone??? This seems to be some kind of caching issue as it happens on the second page load but I think i've go all the caching prevention in place anyways, here's a snipet of the code that ads the jquery functions: if (isset($_SESSION['NO_SCRIPT']) == true && $_SESSION['NO_SCRIPT'] == false) { $html .= '<script type="text/javascript" charset="utf-8">'; $html .= '$.ajaxSetup({ cache: false });'; $html .= '$.ajaxSetup({"error":function(XMLHttpRequest,textStatus, errorThrown) { alert(textStatus); alert(errorThrown); alert(XMLHttpRequest.responseText); }});'; $html .= '</script>'; $html .= '<script type="text/javascript" charset="utf-8">'; $html .= '$(function(){ $("select#searchtype").change(function() { '; $html .= 'alert("change fired!"); '; $html .= '$.getJSON("ajaxgetcategories.php", {id: $(this).val()}, function(j) { '; $html .= 'alert("ajax returned!"); '; $html .= 'var options = \'\'; '; $html .= 'options += \'<option value="0" >--\' + j[0].all + \'--</option>\'; '; $html .= 'for (var i = 0; i < j.length; i++) { options += \'<option value="\' + j[i].id + \'">\' + j[i].name + \'</option>\'; } '; $html .= '$("select#searchcategory").html(options); }) }) }) '; $html .= '</script> '; $html .= '<script type="text/javascript" charset="utf-8"> '; $html .= '$(function(){ $("select#searchregion").change(function() { '; $html .= 'alert("change fired!"); '; $html .= '$.getJSON("ajaxgetcountries.php", {id: $(this).val()}, function(j) { '; $html .= 'alert("ajax returned!"); '; $html .= 'var options = \'\'; '; $html .= 'options += \'<option value="0" >--\' + j[0].all + \'--</option>\'; '; $html .= 'for (var i = 0; i < j.length; i++) { options += \'<option value="\' + j[i].id + \'">\' + j[i].name + \'</option>\'; } '; $html .= '$("select#searchcountry").html(options); }) }) }) '; $html .= '</script> '; }; return $html; remember, this is part of a php funtion that inserts a script into the html and sorry if it looks a bit messy, I'm new to PHP and Javascript and I'm a bit untidy too :) Please also remember that this works perfectly in IE on the first visit but after any navigation I get the error. Thanks guys

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >