Search Results

Search found 17195 results on 688 pages for 'input'.

Page 29/688 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • jQuery - Change background of input field if text getting replaced

    - by ywickham
    I'm currently using jQuery to restrict a text box to number only input as follows: $('input.numbersOnly').keyup(function () { this.value = this.value.replace(/[^0-9\.]/g,''); }); I'd like to let the user know that what they are typing is being rejected by changing the background color of the field. I know that I can change the background of a field using something like this: $('input.numbersOnly').addClass('alertClass'); My question is, how do I combine the two code examples above so that the color of the field changes as the character is getting replaced? My goal is to alert the user that something is wrong with their input as they type it in the field. Thanks!

    Read the article

  • Setting hidden input value in Javascript, then accessing it in codebehind

    - by Siegesmith
    I have been trying to set the value of a hidden input by using Javascript and then access the value from within my C# codebehind. When I run the code that is copied below, the value that is assigned to assignedIDs is "", which I assume is the default value for a hidden input. If I manually set the value in the html tag, then assignedIDs is set to that value. This behavior suggests to me that the value of the input is being reset (re-rendered?) between the onClientClick and onClick events firing. I would appreciate any help with the matter. I have spent hours trying to solve what seems like a very simple problem. html/javascript: <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Admin Page - Manage Tasks</title> <script language="javascript" type="text/javascript"> function PopulateAssignedIDHiddenInput() { var source = document.getElementById('assignedLinguistListBox'); var s = ""; var count = source.length; for (var i = count - 1; i >= 0; i--) { var item = source.options[i]; if (s == "") { s = source.options[i].value; } else { s = s.concat(",",source.options[i].value); } } document.getElementById('assignedIDHiddenInput').Value = s; // I have confirmed that, at this point, the value of // the hidden input is set properly } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:Panel id="EditMode" runat="server"> <table style="border: none;"> <tr> <td> <asp:Label ID="availableLinguistLabel" runat="server" Text="Available"></asp:Label><br /> <asp:ListBox ID="availableLinguistListBox" runat="server" Rows="10" SelectionMode="Multiple"></asp:ListBox> </td> <td> <input type="button" name="right" value="&gt;&gt;" onclick="Javascript:MoveItem('availableLinguistListBox', 'assignedLinguistListBox');" /><br /><br /> <input type="button" name="left" value="&lt;&lt;" onclick="Javascript:MoveItem('assignedLinguistListBox', 'availableLinguistListBox');" /> </td> <td> <asp:Label ID="assignedLinguistLabel" runat="server" Text="Assigned To"></asp:Label><br /> <asp:ListBox ID="assignedLinguistListBox" runat="server" Rows="10" SelectionMode="Multiple"></asp:ListBox> </td> </tr> </table> //-snip- <asp:Button ID="save_task_changes_button" runat="server" ToolTip="Click to save changes to task" Text="Save Changes" OnClick="save_task_changes_button_click" OnClientClick="Javascript:PopulateAssignedIDHiddenInput()" /> </asp:Panel> <!-- Hidden Inputs --> <!-- Note that I have also tried setting runat="server" with no change --> <input id="assignedIDHiddenInput" name="assignedIDHiddenInput" type="hidden" /> </div> </form> </body> c# protected void save_task_changes_button_click(object sender, EventArgs e) { string assignedIDs = Request.Form["assignedIDHiddenInput"]; // Here, assignedIDs == ""; also, Request.Params["assignedIDHiddenInput"] == "" // -snip- }

    Read the article

  • Should we use <label> for every <input>?

    - by metal-gear-solid
    Should we use <label> for every input? , even for submit button and keep hidden thorough css if we don't want to show label. or no need of label for submit button? .hide {display:none} <fieldset> <legend>Search</legend> <label for="Search">Search...</label> <input value="" id="Search" name="Search"> <label for="Submit" class="hide">Submit</label> <input type="submit" value="Go!" name="submit" id="submit"> </fieldset> or we should use like this (no label for submit) <fieldset> <legend>Search</legend> <label for="Search">Search...</label> <input value="" id="Search" name="Search"> <input type="submit" value="Go!" name="submit" > </fieldset>

    Read the article

  • How to prompt user input parameters for SQL Queries in Access 2010

    - by user1848907
    SELECT Transactions.TransactionNumber FROM Transactions WHERE (((Transactions.Date)>=#11/23/12#)) AND (((Transactions.Date)<=#11/23/12#)); The above code returns all the transaction that happened between the specified dates. But I want those dates to be defined by the user every time the query is executed. I tried using the [] operators to have the user define the criteria in the WHERE, something like this: WHERE (((Transactions.Date)>=[Input a Date])) AND (((Transactions.Date)<=[Input a Date])); But microsoft Access throws a Syntax error message. The same happens when I include the # (date operators) like this WHERE (((Transactions.Date)>=#[Input a Date]#)) AND (((Transactions.Date)<=#[Input a Date]#)); Is there anopther way to manage dates that I'm not aware of or is asking a user for dates in a query out of the question

    Read the article

  • infix formula in the input

    - by gcc
    input: sqrt(2 - sin(3*A/B)^2.5) + 0.5*(C*~(D) + 3.11 +B) a b /*there are values for a,b,c,d */ c d input : sqrt(2 - asin(3*A/B)^2.5) +cos(0.5*(C*~(D)) + 3.11 +B) a b /*there are values for a,b,c,d */ c d input: sqrt(2 - sin(3*A/B)^2.5)/(0.5*(C*~(D)) + sin(3.11) +ln(B)) /*max lenght of formula is 250 characters*/ a b /*there are values for a,b,c,d */ c /*each variable with set of floating numbers*/ d As you can see infix formula in the input depends on user. My program will take a formula and n-tuples value. Then it calculate the results for each value of a,b,c and d. If you wonder I am saying ;outcome of program is graph. I dont know way how to store the formula so that I can do my job with easy. can you show me? a,b,c,d is letters cos,sin,sqrt,ln is function

    Read the article

  • clear input textbox value on load

    - by user544079
    I have the following form which is getting pre populated with values on load. I want to have empty input boxes on load using Javascript. However I do not have access to the <body> tag so <body onload="" will not work here. Is there any other way to clear the form fields on load? <form method="POST" action=""> <input name="username" id="user" value="" /><br /> <input name="pwd" id="pass" value="" /> <input type="submit" value="Go" /> </form>

    Read the article

  • javascript created input[type="text'] doesn't post it's variable

    - by ivannovak
    hey there, I'm creating a series of input elements and for some reason their values aren't $_POSTing. Any light shed on the subject would be appreciated! My current code is as follows: javascript Afields = 1; function addAdultInput() { if (Afields != 10) { document.getElementById('adultMembers').innerHTML += "<input type='text' value='' name='adult_members_"+Afields+"' /><br />"; Afields += 1; } else { document.getElementById('adultMembers').innerHTML += "Only 10 Adult Member fields allowed."; document.getElementById('addAdultMember').disabled=true; } } HTML <form name="form1" method="post" action=""> <tr> <td class="style12" valign="top">Adult Members' Names:<br /><small>10 Max </small><input id="addAdultMember" type="button" onclick="addAdultInput()" name="add" value="Add Adult" /></td> <td id="adultMembers"> <span class="erorr">*for paid members only</span><br /> <input type='text' value='' name='adult_members_0' /><br /> </td> </tr> <input type="submit" name="Submit" value="Register"> </form>

    Read the article

  • MYSQL/PHP: Inserting data via HTML form, same "input name"

    - by Camen
    I'm new to MySQL and as a learning project I'd like to make a recipe database. I'd like to the user to be able to enter ingredients through a simple HTML form but I'm stuck in how to label the form so that I can enter several ingredients into the database at once. I'd like to do something like this: <form method="post" action="insert.php"> Ingredient 1: <input type="text" name="ingredient"><br /> Ingredient 2: <input type="text" name="ingredient"><br /> Ingredient 3: <input type="text" name="ingredient"><br /> <input type="submit" value="Submit"> </form> When I do this, I add rows to the table but they're all empty. I know it's got something to do with me using "ingredient" (the table value where I want to add the ingredient name) several times in the form, but I just don't know how to solve it. I would absolutely love some input on how to make it work.

    Read the article

  • Speed up :visible:input selector avoiding filter

    - by macca1
    I have a jQuery selector that is running way too slow on my unfortunately large page: $("#section").find(":visible:input").filter(":first").focus(); Is there a quicker way to select the first visible input without having to find ALL the visible inputs and then filtering THAT selection for the first? I want something like :visible:input:first but that doesn't seem to work.

    Read the article

  • Best way to find all input elements inside a form using jQuery

    - by Aayush
    I need to find all form elements inside inside a form and trigger a flag on change in the value. Currently I am using the method below. I am not sure if this works or not. But It surely works for: .find('input[type=text]) $('#form').find('input[type=text], input[type=radio], input[type=checkbox], select, textarea').each(function(){ $(this).change(function(){ if( change !== 1 ) change = 1; }); }) Now I have added multiple elements with the comma. Will this work and is this the best way to do this. Appreciate all the help. Thanks!

    Read the article

  • Scripting an input element of an HTML form?

    - by dfjhdfjhdf
    By design I need an input element typed text but I do not need an input element typed submit. I want to submit what's written in the input element once the enter key pressed. How would I do that in JavaScript? Do I need tags and other stuff or could I do it without them (just using )?

    Read the article

  • Fill 4 input with one textarea

    - by Patrice Poliquin
    I have a question for the community. My problem is that I have 4 input files with a maxlength of 60 caracters for a total of 240 caracters. Because the "backend" of the customer's system, it need to be 4 differents inputs max to be inserted and they say it is not user-friendly to fill 4 fields. My solution I want to make a textarea and when you fill it, il complete the 4 fields. [input text #1] max60 [input text #2] max60 [input text #3] max60 [input text #4] max60 [textarea max 240] What I am trying to do is to make by javascript/jQuery to fill up the four field while typing in. At the moment, here is my code. $(document).ready(function() { // My text area $("#inf_notes").bind('keydown', function () { var maxLength = 240; if ($(this).val().length <= 60) { // The first 60 caracters $('#inf_notes_1').val($(this).val()); } if ($(this).val().length > 60 && $(this).val().length <= 120) { // If more then 60, fill the second field $('#inf_notes_2').val($(this).val()); } // If 121 - 180 ... // If 181 - 240 ... if($(this).val().length == 240) { $(this).val($(this).val().substring(0, maxLength)); $('.alert_textarea').show(); // Simple alert else { $('.alert_textarea').hide(); } }); }); It actually works for the first one, but I would like to have some feedbacks to help me complete the script to fill the 3 nexts. Any guess to complete it? -- EDIT #1 I found a way that could maybe work! When the first input is completly filled, it will jump to the next field with a .focus() $(".inf_notes").bind('keydown', function () { var notes1 = $('#inf_notes_1').val(); var notes2 = $('#inf_notes_2').val(); var notes3 = $('#inf_notes_3').val(); if (notes1.length == 60) { $('#inf_notes_2').focus(); } if (notes2.length == 60) { $('#inf_notes_3').focus(); } if (notes3.length == 60) { $('#inf_notes_4').focus(); } });

    Read the article

  • how to clear the input value using jquery

    - by rockers
    $("input[id^='exc-flwup-<%=Model.Date%>']").click(function() { $(this).val(''); }); I am using this to clear the input field..when i click on the input box its doign clear but.. on form submit if i ccheck at controler side I am still seeing this value there? do I need to do anyting else here to make null inputbox?

    Read the article

  • IE8 and below <input type="image"> value work around

    - by kielie
    Hi guys, I have a slight problem, I am trying to capture the input of two buttons, one yes, one no, into a database but for some reason the database doesn't always show the value of the button clicked, it just shows up blank. <form action="refer.php" method="post" id="formID" > <div class="prompt_container" style="float: left;"> <span class="prompt_item"><input type="image" src="images/yes.jpg" alt="submit" value="yes" onclick="this.disabled=true,this.form.submit();" /></span> <input type="hidden" name="refer" value="yes"> </div> </form> <form action="thank_you.php" method="post" id="formID" > <div class="prompt_container" style="float: right;"> <span class="prompt_item"><input type="image" src="images/no.jpg" alt="submit" value="no" onclick="this.disabled=true,this.form.submit();" /></span> <input type="hidden" name="refer" value="no" > </div> </form> Apparently anything lower than IE8 will ignore the value attribute of all form inputs. How could I get this to work properly in all browsers? jQuery or Javascript maybe?

    Read the article

  • .focus() doesn't work on an input while orher attributes works

    - by Sirber
    I have a classic table / thead / tbody structure, which I add a line at the end of the tbody. The line contains only an input element. The code works in Firefox 3.6 but not in Chrome v5 or IE8. I'm using jQuery 1.4.1. Does not work: $("#" + AJAX_ID).parent().find('tr:last > td:nth-child(2) > input').focus(); Does work: $("#" + AJAX_ID).parent().find('tr:last > td:nth-child(2) > input').css('background-color', 'red'); even setting an ID on the input, and using document.getElementBuId('id').focus() doesn't work. Thank you!

    Read the article

  • hide inputs value when input is hidden

    - by toingbou
    Hello, im using this function to hide some inputs from a form when a value selected in select tag. this is the function: function showEntry(obj,optionValue){ //hide all entry selections onchange document.getElementById("group1").style.display="none"; document.getElementById("group2").style.display="none"; if(obj.value=="group1") { document.getElementById('group1').style.display="inline"; } else if(obj.value=="group2") { document.getElementById('group2').style.display="inline"; } } and this is the form: <select class="textinput" name="function_title" onchange="showEntry(this,this.value);"> <option value=""> </option> <option value="group1" >group1</option> <option value="group2" >group2</option> </select> <span id="group1" style="display:none;"> <input class="textinput" type="text" id="input1" name="input1" value="100"/> <input class="textinput" type="text" id="input2" name="input2" value="50"/> </span> <span id="group2" style="display:none;"> <input class="textinput" type="text" id="input3" name="input3" value="60"/> <input class="textinput" type="text" id="input4" name="input4" value="45"/> </span> All i want is to hide the hidden inputs value when this group of inputs are hidden. Something like that: <input class="textinput" type="text" id="input3" name="input3" value="if(obj.value!="group2") { print(60); }"/> Is that right?

    Read the article

  • Get name and value from the input tag

    - by DroidIn.net
    Before you say "oh no, not again" here I'm stating my case. I'm parsing part of HTML output and the only thing I'm interested in is name and value attributes of each <input/ tag. HTML is actually HTML fragment, may not be well-formed. I don't have DOM or HTML parser and I don't try to parse nested elements anyway. The problem is that I don't know the order or number of attributes so it could be <input name="foo" value="boo"/> or <input type="hidden" name=foo> or <input id=blah value='boo' src="image.png" name="foo" type="img"/>. Is there a single regular expression that would get me values of name and value attribute in predictable order? I wouldn't have asked the question if I could assume that name attribute always precedes value but unfortunately this is not the case

    Read the article

  • Hidden input text submit with jquery

    - by Lucas Silva de Freitas
    I have a javascript var that returns the value of a input text named "pro_barras", with the value of "pro_barras" I need to make a search in my database without submiting the page. I can't use a javascript var in the java code, so i've setted the value in a hidden input text named "hidden_barra", but I need to submit it to get the value with the java code and make the search...How do I do it ? <input type="text" id="pro_barras"> <input type="hidden" id="hidden_barra"> <script> var barra = document.getElementById('pro_barras').value; document.getElementById('hidden_barra').value = barra; var ref = <%=pd.getProdutosBarra(">VAR 'barra' HERE or request.getParameter("hidden_barra")<").getPro_referencia()%>; </script>

    Read the article

  • Copy subset of xml input using xslt

    - by mdfaraz
    I need an XSLT file to transform input xml to another with a subset of nodes in the input xml. For ex, if input has 10 nodes, I need to create output with about 5 nodes Input <Department diffgr:id="Department1" msdata:rowOrder="0"> <Department>10</Department> <DepartmentDescription>BABY PRODUCTS</DepartmentDescription> <DepartmentSeq>7</DepartmentSeq> <InsertDateTime>2011-09-29T13:19:28.817-05:00</InsertDateTime> </Department> Output: <Department diffgr:id="Department1" msdata:rowOrder="0"> <Department>10</Department> <DepartmentDescription>BABY PRODUCTS</DepartmentDescription> </Department> I found one way to suppress nodes that we dont need XSLT: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes"/> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="Department/DepartmentSeq"/> <xsl:template match="Department/InsertDateTime"/> </xsl:stylesheet> I need an xslt that helps me select the nodes I need and not "copy all and filter out what I dont need", since i may have to change my xslt whenever input schema adds more nodes.

    Read the article

  • Selecting text between Brackets in an input field with Jquery

    - by Marcel
    Hi, with $("#TextInputElement").select() I am able to select a text (mark it) in an in an input text field. Now I only want to select the text in between brackets in that input field. I have the regular expression match(/-[^-]*-/) to select, but how would I apply this to only select the text inside the input field between brackets? [noselect]textToBeSelected[/noselect] thx

    Read the article

  • How do i find dynamic average for not the 20 input boxes

    - by alpho07
    How do i find dynamic average for not the 20 input boxes with ".num" class but even just five out of 20. I have done it as below but it won't work $.fn.sumValues = function() { var sum = 0; this.each(function() { if ( $(this).is(':input') ) { var val = $(this).val(); } else { var val = $(this).text(); } sum += parseFloat( ('0' + val).replace(/[^0-9-\.]/g, ''), 10 ); }); return sum.toFixed(2); }; $(document).ready(function() { $('input.price').bind('keyup', function() { $('span.total').html( $('input.price').sumValues()/$('.num').length ); }); });

    Read the article

  • Input field name starts with a number

    - by fire
    I have an input field whose name is an MD5 string e.g.: <input type="hidden" name="7815696ecbf1c96e6894b779456d330e" value="1"> Now I understand that having a number as the first letter in an input field name is generally bad practice, but are there any side-effects to this such as a certain browser won't send it in the POST request?

    Read the article

  • How to disable an input with jQuery Validation Plugin

    - by Eelke
    This should be really simple but I can't get it to work, how do I disable and add a class to an input? Let's say I've got an input field with id = name, this is how far I got, $("input#name").attr("disabled"); What am I doing wrong here? Any help would be greatly appreciated, thanks in advance!

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >