Search Results

Search found 4316 results on 173 pages for 'disabled'.

Page 36/173 | < Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >

  • ASP.NET MVC - Disable Html Helper control using boolean value from Model

    - by The Matt
    I am outputting a textbox to the page using the Html helpers. I want to add the disabled attribute dynamically based on whether or not a boolean value in my model is true or false. My model has a method that returns a boolean value: <% =Model.IsMyTextboxEnabled() %> I currently render the textbox like follows, but I want to now enabled or disable it: <% =Html.TextBox("MyTextbox", Model.MyValuenew { id = "MyTextbox", @class = "MyClass" })%> If the return value of Model.IsMyTextboxEnabled() == true I want the following to be output: <input class="MyClass" id="MyTextbox" name="MyTextbox" type="text" value="" /> If it == false, I want it to output as: <input class="MyClass" id="MyTextbox" name="MyTextbox" type="text" value="" disabled /> What is the cleanest way to do this?

    Read the article

  • Enable Datepicker only when first field has a value

    - by Syed Abdul Rahman
    Right now, the End Date selection is disabled. I want to only enable this when a Start Date is selected. if( $('#datepicker1').val().length === 0) { $('#datepicker2').datepicker("disable"); } else { $('#datepicker2').datepicker("enable"); } This clearly does not work. If I insert value = 'random date' into my first input field, it works fine. I'm not too sure on how do this. Clearly not as easy as I had hoped. My other problem, or hope, is to disable the dates including and before the first selection. You know, pick Start Date, and every date before and said date for the next picker would be disabled. But that is a whole other problem.

    Read the article

  • Lock HTML select element, allow value to be sent on submit

    - by ILMV
    I have a select box (for a customer field) on a complex order form, when the user starts to add lines to the order they should not be allowed to change the customer select box (unless all lines are deleted). My immediate thought was that I could use the disabled attribute, but when the box is disabled the selected value is no longer passed to the target. When the problem arose a while ago one of the other developers worked around this by looping through all the options and disabling all but the selected option, and sure enough the value was passed to the target and we've been using since. But now I'm looking for a proper solution, I don't want to loop through all the options because are data is expanding and it's starting to introduce performance issues. I'd prefer not to enable this / all the elements when the submit button is hit. How can I lock the input, whilst maintaining the selected option and passing that value to the target script? I would prefer a non-JavaScript solution if possible, but if needed we are running jQuery 1.4.2 so that could be used.

    Read the article

  • PHP Dynamic include based on current file path

    - by Adrian M.
    Hello, I want to find a method to include some files based on the current file path.. for example: I have "website.com/templates/name1/index.php", this "index.php should be a unique file that I will use in many different directories on different depths, so I want to make the code universal so I don't need to change anything inside this file.. So if this "index.php" is located in "website.com/templates/name1/index.php" than it should include the file located here: "website.com/content/templates/name1/content.php" another example: "website.com/templates/name2/index.php" than it should include the file located here: "website.com/content/templates/name2/content.php" Also I want to overrun "*Warning: include_once() [function.include-once]: http:// wrapper is disabled in the server configuration by allow_url_include=0*" kind of error.. because is disabled and unsafe.. Is there a way to achieve this? Thank you!

    Read the article

  • Making a field unavailable to a user with javascript in MS CRM 4

    - by mwright
    I am trying to disable a field, i.e. grey it out and not allow the user to select it. To achieve this effect I am currently calling crmForm.all.new_attribute1.disabled = true; crmForm.all.new_attribute2.Disabled = true; The Disable, with a capital D, makes the field grayed out but the user can still put the cursor in that field or tab to it. The disable, with a little d, makes the field unavailable to the cursor and via tab, but gives no visual indication that it can't be interacted with. Is there a better way to do this, one call that will achieve similar results or am I stuck having both there?

    Read the article

  • How to update control state in asp.net/ajax?

    - by darth_alexious
    I'm trying to update certain controls according to a selection in a dropdown list. For example, in the "selectedIndexChanged" event of a dropDownList, if a user selects the value "sport-car" the text box "payload" is disabled and the textbox "max speed" is enabled. private sub dropDownList1_SelectedIndexChanged(byval sender as object, byval e as eventargs) handles dropDownList1.SelectedIndexChanged If dropDownList1.selectedValue = "sport-car" then textBox_payLoad.enabled = false textBox_maxSpeed.enabled = true end if end sub When I'm doing something like this, the controls aren't enabled/disabled, even the event (wich I've added a breakpoint) seems not to be raised (sometimes several time after it is raised). Also, when the instructions in the condition is executed, nothing changes. What am I doing wrong? Maybe this is a very easy issue, but I'm a begginer in MS Visual Web Developer.

    Read the article

  • Scroll event of jquery is not working in IE 7 with IE 7 standard but works in IE8,9

    - by SidP
    I have an example below which has a terms div which has some terms and conditions as content. When the user scroll the div to bottom, then the checkbox is enabled. This is only not working only in IE 7 with IE 7/8/9 standards (I am changing the standard options from Developer window). Following is my html, css and js: <body> <div id="terms">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer lacinia dui vel velit bibendum cursus. Nunc eget lacus vitae nulla euismod elementum ornare ac urna. Nam enim est, bibendum eu ultricies eu, mollis vitae lacus. Duis porta vulputate feugiat. Nullam eu iaculis lacus. Aliquam adipiscing posuere consequat. Donec et dui non massa congue eleifend. Nunc tortor diam, luctus eget mollis sit amet, posuere nec lectus. Morbi sit amet ultricies nisi. Nam sodales quam non mi tristique sollicitudin. Vestibulum vel augue eget mi tincidunt commodo. Sed egestas metus nibh, et vestibulum augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer lacinia dui vel velit bibendum cursus. Nunc eget lacus vitae nulla euismod elementum ornare ac urna. Nam enim est, bibendum eu ultricies eu, mollis vitae lacus. Duis porta vulputate feugiat. Nullam eu iaculis lacus. Aliquam adipiscing posuere consequat. Donec et dui non massa congue eleifend. Nunc tortor diam, luctus eget mollis sit amet, posuere nec lectus. Morbi sit amet ultricies nisi. Nam sodales quam non mi tristique sollicitudin. Vestibulum vel augue eget mi tincidunt commodo. Sed egestas metus nibh, et vestibulum augue. </div> <input type="checkbox" name="cb1" id="cb1" disabled="true" /> </body> CSS: <style type="text/css"> #terms { height: 100px; overflow: auto; } body{ width:960px; margin: 0 auto; } </style> JS: <script src="jquery-1.8.1.js"></script> <script type="text/javascript">//<![CDATA[ $(window).load(function(){ $('#terms').scroll(function() { if ($(this)[0].scrollHeight - $(this).scrollTop() == $(this).outerHeight()) { $("#cb1").removeAttr("disabled"); } else { $("#cb1").attr("disabled", "true"); } }); });//]]> </script>

    Read the article

  • ASP.NET: Why can't I call a web-service twice in one page?

    - by Shay
    Hi all! I built a web-application which calls a web-service twice in the application's log-in page - first, on Page_Load, and the second time is after a button click. When debugging, everything goes well, but after publishing the web-application and trying it - I cannot make the two calls for the web-service (each call is invoking a different function in the same web-service). If I call it once (say, in the Page_Load) its OK, but once I get to the button click event, the page just seems to be loading but actually doing nothing (loading to infinity). When I disabled the web-service call in Page_Load, the web-service call after the button click worked well, and if I switched between them (disabled the call in button click and enabled the call in Page_Load) the enabled one worked OK. How come this is happening? What did I do wrong? Could it be related to the fact that the location where I published my web-application has some URL-rewriting rules?

    Read the article

  • Populate FILE field with default text

    - by dclowd9901
    I'm trying to reutilize code that generates FILE fields for use when something is to be added to the database, and grayed out (and disabled) with data already in the database when the item in question is being edited or viewed in detail. However, I can't seem to get the text to fill the field. I'm using this: echo '<input type="file" name="small[]" value="' . $value_from_database . '" DISABLED><br>'; Am I missing anything? If not, are there any decent workarounds?

    Read the article

  • disabling dropdownlist inside a gridview based on value selected on another dropdownlist inside the gridview from javascript or jquery

    - by Joy
    what i m trying is i hav two dropdownlists inside the gridview... namely say ddonsiteoffsite and ddhours... now what i want is if the selectedtext of ddonsiteoffsite is "onsite" the ddhours should b disabled... i tried the code snippet but ... its not disabling the ddhours... can someone help me please.. <asp:TemplateColumn HeaderText=" OnSite/OffSite" > <ItemTemplate> <asp:DropDownList ID="ddOnsiteOffside" runat="server" onchange="ToggleOnOff(this)"><asp:ListItem Text = "Offsite" Value="Offsite"></asp:ListItem> <asp:ListItem Text = "Onsite" Value="Onsite"></asp:ListItem> </asp:DropDownList> </ItemTemplate> </asp:TemplateColumn> <asp:TemplateColumn> <ItemTemplate> <asp:DropDownList ID="ddhours" runat="server"> <asp:ListItem Text = "1" Value="1" ></asp:ListItem> <asp:ListItem Text = "2" Value="2" ></asp:ListItem> <asp:ListItem Text = "3" Value="3" ></asp:ListItem> <asp:ListItem Text = "4" Value="4" ></asp:ListItem> <asp:ListItem Text = "5" Value="5" ></asp:ListItem> <asp:ListItem Text = "6" Value="6" ></asp:ListItem> <asp:ListItem Text = "7" Value="7" ></asp:ListItem> <asp:ListItem Text = "8" Value="8" ></asp:ListItem> <asp:ListItem Text = "9" Value="9" ></asp:ListItem> </asp:DropDownList> </ItemTemplate> </asp:TemplateColumn> and the corresponding javascript i am using is : enter code here function ToggleOnOff(ddonoff) { var row = chk.parentNode.parentNode; if(ddonoff.value=="Onsite") { row.getElementsByTagName("ddhours")[0].disabled = true; } else row.getElementsByTagName("ddhours")[0].disabled = false; } can someone help to achieve this ?? using javascript or jquery ? i m not understanding where i went wrong ...

    Read the article

  • Parenthesis operator in C. What is the effect in the following code

    - by Andre
    Hi everyone, I was playing with a macro to enable/disable traces when I came out with the following code when the macro is disabled: int main { ("Hello world"); } This code is valid and I got the desired effect (nothing happens when the macro is disabled) but I couldn't figure out what exactly is happening. Is the compiler seeing the parenthesis as a "nameless" method declaration? To make it clearer the code is : #ifdef TRACE #define trace printf("%s %d -> ",__FILE__, __LINE__);printf else #define trace #endif int main { trace("Hello world"); } Thanks in advance.

    Read the article

  • HTML/Javascript Strange behavior with input field and TABBING

    - by Berlin Brown
    I have a strange error where if a user enters in data, say first name and then tabs, the text in the field is highlighted/selected as opposed to moving to the next. So, a person may type the first name and then tab to the next input item, text is selected and then they hit a character and now the name they typed in is deleted. If I use the default [input] tags, the tab works properly. But in the code below, with keyup, that may change the tabbing behavior. How can I get my code where it won't select the text. This is replicated in Firefox and Internet Explorer. function enableSearch(lnameObj) { var goButtonObj = document.getElementById('goButton'); var nextButtonObj = document.getElementById('nextButton'); var lastName = lnameObj.value; if (lastName == "") { goButtonObj.disabled = true; } else { goButtonObj.disabled = false; } } <input type="text" size="12" name="lastname" onKeyUp="return enableSearch(this);" value="">

    Read the article

  • Disable buttons on post back using jquery in .net app

    - by Chris Lively
    I have a asp.net app that I want to disable the buttons as soon as they are clicked in order to prevent multiple submissions. I'd like to use jquery for this as the site already liberally uses it anyway. What I've tried is: $(document).ready(function () { $("#aspnetForm").submit(function () { $('input[type=submit]', $(this)).attr("disabled", "disabled"); }) }); The above will disable the button, and the page submits, but the asp.net button on click handler is never called. Simply removing the above and the buttons work as normal. Is there a better way?

    Read the article

  • ValidateRequest = False but in action it's still True and ignored that?

    - by Sadegh
    hi guy's, i want disable RequestValidation on particular view in ASP.NET MVC 2.0 RTM. so i added some necessary to view Page directive section as below: <%@ Page ValidateRequest="false" Language="C#" MasterPageFile="Path" Inherits="System.Web.Mvc.ViewPage<Path>" %> but RequestValidation isn't Disabled! i also added RequestValidation Attribute to related action in controller as below: [System.Web.Mvc.ValidateInput(false)] public System.Web.Mvc.ActionResult Create(Model instance) { //Do here something } :') but RequestValidation isn't Disabled too! in last try i set RequestValidation to false in Web.config file as below: <pages validateRequest="false" /> RequestValidation still isn't turned off! Why? thank's in advance ;)

    Read the article

  • How to replicate this screenshot in WebForms?

    - by AngryHacker
    I need to replicate the following in ASP.NET WebForms using a GridView. But I am not sure where to start. Basically I need 3 columns. The checkbox (which sometimes needs to be disabled), and 2 standard text columns. I've gone through the tutorial and I can see how to basically dump text data into a GridView, but not clear on how to implement checkboxes, particularly ones that needs to be disabled once in a while. And I have to replicate the style of the screenshot (e.g. border on the bottom). Having trouble with that as well. How do I swing something like that?

    Read the article

  • SQL Server Service Broker Service Disappearing (Automatically Deleted)?

    - by mwigdahl
    I've implemented a messaging system over SQL Server Service Broker. It is working great, with the sole exception that every once in a while (maybe once per week per server) my initiator service just vanishes without a trace. The corresponding queue is still there, but the service is missing. Obviously this causes problems in my system. It's a simple matter to recreate the service by hand, but I'm confused as to what might cause this behavior. I understand that automatic poison message handling causes queues to be disabled, but I don't see anything that indicates services can be disabled or deleted automatically. When this happens, I usually have a large backlog of messages in multiple application queues, but nothing extreme. Total message backlog is around 200,000. Does anyone know what might be happening here?

    Read the article

  • Passing enums to functions in C++

    - by rocknroll
    Hi all, I have a header file with all the enums listed (#ifndef #define #endif construct has been used to avoid multiple inclusion of the file) that I use in multiple cpp files in my application.One of the enums in the files is enum StatusSubsystem {ENABLED,INCORRECT_FRAME,INVALID_DATA,DISABLED}; There are functions in the application delcared as ShowStatus(const StatusSubsystem&); Earlier in the application when I made calls to the above function like ShowStatus(INCORRECT_FRAME); my application used to compile perfectly. But after some code was added The compilation halts giving the following error: File.cpp:71: error: invalid conversion from `int' to `StatusSubsystem' File.cpp:71: error: initializing argument 1 of `void Class::ShowStatus(const StatusSubsystem&) I checked the code for any conflicting enums in the new code and it looked fine. My Question is what is wrong with the function call that compiler shows as erroneous? For your reference the function definition is: void Class::ShowStatus(const StatusSubsystem& eStatus) { QPalette palette; mStatus=eStatus;//store current Communication status of system if(eStatus==DISABLED) { //select red color for label, if it is to be shown disabled palette.setColor(QPalette::Window,QColor(Qt::red)); mLabel->setText("SYSTEM"); } else if(eStatus==ENABLED) { //select green color for label,if it is to be shown enabled palette.setColor(QPalette::Window,QColor(Qt::green)); mLabel->setText("SYSTEM"); } else if(eStatus==INCORRECT_FRAME) { //select yellow color for label,to show that it is sending incorrect frames palette.setColor(QPalette::Window,QColor(Qt::yellow)); mLabel->setText("SYSTEM(I)"); } //Set the color on the Label mLabel->setPalette(palette); } A strange side effect of this situation is it compiles when I cast all the calls to ShowStatus() as ShowStatus((StatusSubsystem)INCORRECT_FRAME); Though this removes any compilation error, but a strange thing happens. Though I make call to INCORRECT_FRAME above but in function definition it matches with ENABLED. How on earth is that possible? Its like while passing INCORRECT_FRAME by reference, it magically converts to ENABLED, which should be impossible. This is driving me nuts. Can you find any flaw in what I am doing? or is it something else? The application is made using C++,Qt-4.2.1 on RHEL4. Thanks.

    Read the article

  • Stubborn UIButton

    - by Mike
    I have a UIButton that is supposed to be disabled during certain phases. So, when this happens I do [myButton setEnabled:NO]; This is perfect because the button stays grayed and if clicked will not trigger its action, but... when the button is clicked even grayed, it enables again and a second click will trigger its actions (???????!!!!!!!!!!). How can that be? If the button is disabled it is supposed to be "part of the background", i.e., an image without any action. I have tried to make the button vanish using alpha but even if you click on the empty spot, it reappears after the first click and then can trigger actions after the second click... (????) Am I missing something?

    Read the article

  • innerHTML within another tag

    - by jimbo
    Hi all, I have a link: <a id="nextBut" href="somelink" class="button"><span>Next Step</span></a> And I can control the the <span>Next step</span> part with innerHTML but how could I leave the <span> alone and just change the 'Next step' part? For example: var NextButJar = document.getElementById('nextBut'); NextButJar.disabled = true; NextButJar.style.opacity = .5; NextButJar.span.innerHTML = 'Read all tabs to continue'; I also have: NextButJar.onClick = handleClick; function handleClick(){ if (this.disabled == true) { alert("Please view all tabs first!"); return; } else { alert("allowed to run"); } }; Which I can't seem to get working either...

    Read the article

  • How to disable the Input,textarea,selector using this code in the Fieldset

    - by kumar
    Hello friends I am using this code in my view.. $("#Fieldset1").find("input, select,textarea").attr('disabled', 'disabled'); this code i am in one view...for one user only one time...if I select 3 users this view will execute three times.. using this code I can able to disable inputfor one one time. its not doing for second time that is second user on the page. why its happening? I need to disable for how many users I select.... thanks..

    Read the article

  • Alter multiple tables' columns length

    - by gdoron
    So, we just found out that 254 tables in our Oracle DBMS have one column named "Foo" with the wrong length- Number(10) instead of Number(3). That foo column is a part from the PK of the tables. Those tables have other tables with forigen keys to it. What I did is: backed-up the table with a temp table. Disabled the forigen keys to the table. Disabled the PK with the foo column. Nulled the foo column for all the rows. Restored all the above But now we found out it's not just couple of tables but 254 tables. Is there an easy way, (or at least easier than this) to alter the columns length? P.S. I have DBA permissions.

    Read the article

  • jquery ajax request is Forbidden in IE. How to fix (any workaround)?

    - by 1gn1ter
    <script type="text/javascript"> $(function () { $("select#oblast").change(function () { var oblast_id = $("#oblast > option:selected").attr("value"); $("#Rayondiv").hide(); $.ajax({ type: "GET", contentType: "application/json", url: "http://site.com/Regions.aspx/FindGorodByOblastID/", data: 'oblast_id=' + oblast_id, dataType: "json", success: function (data) { if (data.length > 0) { var options = ''; for (p in data) { var gorod = data[p]; options += "<option value='" + gorod.Id + "'>" + gorod.Name + "</option>"; } $("#gorod").removeAttr('disabled').html(options); } else { $("#gorod").attr('disabled', false).html(''); } } }); }); }); </script>

    Read the article

  • disabling a window

    - by Arno Greiler
    In my application I have a button. If the button is clicked as select against a database is executed and the result is shown in a ListView. As the select is quite complex, it takes some time to retrieve the data. When I click the Button, the Application-Window should be disabled until the data is loaded. But when I set the IsEnabled-Property of the Window to false, the Window gets disabled after the data is loaded. I tried to disable the Window in an other thread with a BackgroundWorker. But then I get an exception that the Window is alreay in use by an other thread. How can I disable the Window bevore it retrieves the data?

    Read the article

  • form doesn't work after use render

    - by Rodrigo
    I trying to use render method inside my activeAdmin form method, but after insert render in code, it stopped to work. form do |f| f.inputs I18n.t('sale_header') do f.input :client f.input :room end f.inputs I18n.t('sale_items') do render :partial => "form_sale" end f.inputs I18n.t('totalization') do f.input :sub_total, :input_html => { :disabled => :true } f.input :discount f.input :total_value, :input_html => { :disabled => :true } end f.buttons end After insert the render method, only form_sale content is showed on screen. Any help? Thank You!

    Read the article

< Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >