w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
selecting text next to an checked input checkbox using JQuery (or JS)?
You can use: <input ... onclick="alert(this.nextSibling.data);"> Of course that is very dependent on the structure of the DOM. You may want to concatenate the data in all the text nodes from this element to the next, so you might need a function like: function getTextByNodes(el) { var text =''; while (el && el.nextSibling && el.nextSibling.nodeType == 3) { text += el.nextSibling.data; el = el.nextSibling; } return text; } with: <input ... onclick="alert(getTextByNodes(this));">

Categories : Javascript

How to turn a hidden type input into a checkbox type input?
Give all inputs the class input_skill, like this: echo '<div class="skillName"><input type="hidden" name="skill[]" value="' . $userSkills[$x] . '" title="Click to select" class="input_skill">' . $userSkills[$x] . "</div>"; Then use this function to change their types: <script type="text/javascript"> function ShowSkillCheckboxes() { var skills = document.getElementsByClassName("input_skill"); for(var i=0; i<skills.length; i++) skills[i].setAttribute("type","checkbox"); } </script> Keep in mind that the special checked value which the elements get by becoming checkboxes will vanish once you transform the checkboxes back into hidden type inputs. Besides: hidden inputs do not display at all on the webpage. You can say they have 0x0 px dime

Categories : Javascript

Define CSS style for single input ID, instead of input[type=checkbox]
input#A1 input#A2 input#A1:checked input#A2:checked But you don't need to specify the tag name (input) if you don't want. But it can be useful though! (Especially with classes) Read more about (ID-)selectors in the docs.

Categories : CSS

Input control type Checkbox always true
You should be using input type radio, not checkbox, for two mutually exclusive selections: <input runat="server" type="radio" name="chkChildSex" value="male" id="chkChildSexMale" /> <input runat="server" type="radio" name="chkChildSex" value="female" id="chkChildSexFemale" /> When you use the same name attribute for two checkboxes, the second overrides the first. When you use the same name attribute for two radio buttons, it associates them and the value is the value of the checked item.

Categories : C#

input type checkbox not working inside bootstrap modal
Guess you try to overcome bootstrap modals e.preventDefault() in click events - this is why it never works. Also the two events seems to obsulete each other? Try this instead : $('.checkInp input:checkbox').on('click', function(e) { // prevents the event from bubbling up the DOM tree // eg the modal from cancelling the event e.stopImmediatePropagation(); var checked = (e.currentTarget.checked) ? false : true; e.currentTarget.checked=(checked) ? false : checked.toString(); }); forked fiddle : http://jsfiddle.net/AurPX/

Categories : Javascript

PHP JQuery Checkbox Array - Selecting only 1 value
Ignoring the many issues with the code and simply answering the question: You need to refer to the checkboxes using a class name not a ID (you have given them all the same ID) For these lines: $options .= "<br><input type=checkbox name="".$table."[]" value='$r->Field' id="$table">" . $r->Field; Change to: $options .= "<br><input type=checkbox name='" . $table . "[]' value='" . $r->Field ."' class='" . $table . "'>" . $r->Field; For this line: $click = "$('#$table').attr('checked', 'checked')"; use single quotes or escape the $ Change to: $click = '$("."'.$table.'").attr("checked", "checked")';

Categories : PHP

Uncheck all Checkbox in Gridview when selecting one in vb.net
Why not just group radio buttons in a groupbox?? Wouldnt that work better though? What is this statement meant to do Dim cb As CheckBox = DirectCast(GridView3.Rows(i).Cells(0).FindControl("CheckBox1"), CheckBox) ? Extract data from a datagrid cell and assign it to a checkbox?? You can just use radD.Text = dgData.Rows(tracker1).DataBoundItem("OptionD").ToString where tracker1 is column index and "OptionD" is column name and radA.text is the text in the radio button. and dgData is the name of the datagrid view

Categories : Vb.Net

How to post textbox value after selecting particular checkbox
You can check the value of your checkbox, and if it equals to other, you can grab your value from textbox. Do it following way: if (isset($_POST['goal']) && $_POST['goal'] == 'other') { // do something with $_POST['other'] }

Categories : PHP

How to create pop up on selecting the checkbox in HTML
please check following links http://jqueryui.com/dialog/#modal-form http://www.mywebdeveloperblog.com/my-jquery-plugins/modalpoplite

Categories : Javascript

Selecting checkbox value that is nested in several spans
You have the wrong syntax to target the checkbox. Use find to get it first. Also checked property is boolean.. Not a string if ( $(this).find('checkbox').is(':checked')) { // Add class } else { // remove class } UPDATE $('.checkbox-243 .petsCheckBox input[value="Yes"]').change(function () { var $this = $(this); if ( $this.is(':checked')) { $this.closest('p').addClass('red'); } else { $this.closest('p').removeClass('red'); } }); Check Fiddle

Categories : Jquery

make visible checkbox after selecting radiobutton
Using plain JavaScript, I'd suggest: function showSelects (radio) { var id = 's' + radio.value, curActive = document.querySelector('select.active'), target = document.getElementById(id); if (curActive !== null) { curActive.classList.remove('active'); } target.classList.add('active'); } var radios = document.querySelectorAll('input[type=radio][name=sl]'); for (var i = 0, len = radios.length; i < len; i++) { radios[i].addEventListener('change', function(){ showSelects(this); }); } The above requires the following CSS: select { display: none; } select.active { display: block; } JS Fiddle demo. This is, though, restricted to fairly up-to-date browsers. With jQuery it'd be as simple as: I'd suggest: $('input[type=rad

Categories : Javascript

Change input type="text" to input type="password" onfocus()
You dont need to replace the component, just set the type of the this to password like the code below: <asp:TextBox ID="txtPassword" runat="server" SkinID="txtLogin" value="Password..." TabIndex="2" onfocus="this.type='password'"> Here is a jsfiddle working example: http://jsfiddle.net/mZyTG/ Update I didn't test this code, but it add one onblur event listener to newO, and when invoked it replace the input to the old one. function replaceT(obj) { var newO = document.createElement('input'); newO.setAttribute('type', 'password'); newO.setAttribute('class', 'textbox'); newO.setAttribute('name', obj.getAttribute('name')); newO.addEventListener("onblur", function(){newO.parentNode.replaceChild(obj, newO)}, false); obj.parentNode.replac

Categories : Javascript

jQuery selecting a checkbox inside form issue
You missed $ in your second example (in the first one too, but with wrong approach) - if($('#other_langs input[name="yes"]').prop('checked') == true){ alert('ok'); } Demo ---> http://jsfiddle.net/zKkXp/ You can make your first example work like this - if($('#other_langs input').first().prop('checked') == true){ alert('ok'); } Demo --> http://jsfiddle.net/zKkXp/1/

Categories : Jquery

selecting all checkboxes in javascript - with array of different values for checkbox
This won't work this way, because none of your checkboxes has the name "checkbox[]". You could get all checkboxes by giving them a class and use the getElementsByClassName function. So the line where you get the checkboxes would look like this: var checkboxes = document.getElementsByClassname('yourClassName'); And in the html you just assign the checkboxes the class 'yourClassName'. Note that getElementsByClassname is not supported by some older browsers.

Categories : PHP

Selecting a specific checkbox in a long listview checks multiple checkboxes
The first thing I'm noticing is if (!item.getFbId().isEmpty()) { firstNameTV.setText(" " + item.getFirstName()); lastNameTV.setText(" " + item.getLastName()); Bitmap image = item.getImage(); if(image != null) { picIV.setImageBitmap(image); } } Setting these values only in certain cases is a big no-no. Remember that your views are being reused, so if you ever set any of these properties, you can't count on them ever having the default value. They might still be set from the last item. Try logic that looks more like this: if (!item.getFbId().isEmpty()) { firstNameTV.setText(" " + item.getFirstName()); lastNameTV.setText(" " + item.getLastName()); Bitmap image = item.getImage();

Categories : Android

Show/Hide specific DIV when selecting an checkbox Button from a dropdown using jQuery
You're always showing both of the divs via class (.desc), and hiding the second. You're never hiding the first - even after two clicks it'll remain visible as you're using show(). Replace $("div.desc").show(); with $("div.desc").toggle(); This will toggle the show() state, first click it'll show, second it'll hide etc. jsFiddle here.

Categories : Javascript

how to change data in the column as "N" automatically instead of deleting, after selecting the checkbox &click on delete button
u can write update statement int cnt= int.Parse(GridView1.DataKeys[row.RowIndex].Value.ToString()); SqlConnection con = new SqlConnection(constr); string sql = "update PA_webwork set state 'N' where sno = @sno "; SqlCommand cmd = new SqlCommand(sql, con); cmd.Parameters.AddWithValue("@sno", cnt); con.Open(); cmd.ExecuteNonQuery(); con.Close();

Categories : Asp Net

Can I get to look like ?
First "hack" I can think of would be to add a "data-changed" attribute to the input="password" field, then attach an "onchange" event to the password field that sets "data-changed" == true, so that way you can validate if the value "password" was in fact entered by the user (data-changed == true) or if it is being submitted by the placeholder plugin itself.

Categories : Javascript

input type submit vs input type button
To submit your form, the input field must be of the type submit, not button. <input type="submit" name="submit1" class="submit" value="Create Account!" onclick="validateFields()" /> You can also do: <button type="submit" name="submit1" class="submit" onclick="validateFields()"> Create Account! </button> And, to avoid your form from being submitted if there are errors, you can return false: function validateFields() { //do validation if(failed) { return false; } }

Categories : PHP

CSS input checkbox when input is already defined
You need to apply the style from the id #msform to overwrite completely the previous declaration. #msform input[type=checkbox] { width: 13px; height: 13px; padding: 0; margin:0; vertical-align: middle; position: relative; top: 26px; right: 60px; overflow: hidden; } Try playing with it now.

Categories : Jquery

selecting max value excel using Cells(x,y) as input
You can use the function Max on Application.WorksheetFunction where you use a Range from Cells(m, 1) to Cells(n, 1): Cells(Count, 4)=Application.WorksheetFunction.Max(Range(Cells(m, 1),Cells(n, 1))) This will return max into Cells(Count, 4)

Categories : Excel

CSS nth-of-type not selecting in order
And, for anyone that does not have nth-of-type() support: var btmColors = []; btmColors[0] = 'red'; btmColors[1] = 'blue'; btmColors[2] = 'green'; btmColors[3] = 'yellow'; $('div.cake').css('border-bottom-width', '3px').css('border-bottom-style', 'solid').css ('border-bottom-color', function (i) { return btmColors[i % 4]; }); js Fiddle

Categories : Javascript

jquery set value from input type file multifile to input type file single file for multiple file upload
It is not possible to programatically select files into a an <input type="file" />. The reason for this is security. Consider if it was possible - it would mean that unscrupulous developers could essentially steal files from visitors computers by using Javascript to select a file and submit the form without the user knowing.

Categories : Jquery

Selecting a part of the contents of an input using jQuery
That's because $("#boink") is a jQuery object and not the DOM element itself. In order to make those 2 lines equivalente you should do $("#boink")[0].selectionStart = 3; The array contains all matched DOM elements. Since you're selecting by id, one element can match as most so you just pick the first one using [0]

Categories : Jquery

Hidden input when selecting radio button
You can use .change events: $("input[type='radio']").change(function() { //Check the value for "paypal", also verify that the radio is checked if (this.value == "paypal" && this.checked) { $("#account_number, #account_owner").hide(); } else { //I figured you would want to unhide these if paypal isnt checked, here's the else $("#account_number, #account_owner").show(); } });

Categories : Javascript

Show input based on selecting option
You need to register the handler to the payment_method elements change event $(document).ready(function(){ $("select[name='payment_method']").change(function(){ var option_value = $(this).val(); if(option_value=='paypal') { $(".box1").css("display","block"); $(".box2").css("display","none"); } else if(option_value=='havale') { $(".box2").css("display","block"); $(".box1").css("display","none"); } }); $(".box1").show(); $(".box2").hide(); }); Demo: Fiddle

Categories : Javascript

jQuery: selecting first empty text input
You're using an attribute selector, but the value attribute isn't updated when the value of the input changes. Instead, loop through them, and only focus on the one that actually has an empty value: $('input[name="userinput[]"]').each(function() { if ( this.value === '' ) { this.focus(); return false; } }); Here's your fiddle: http://jsfiddle.net/TYjNE/2/

Categories : Jquery

How to restrict user input character length of HTML5 input type="number"?
I don't know my answer is useful for you? But i happy if i can help you. you should write a js method and then use it in your html page. function limit(element) { var max_chars = 2; if(element.value.length > max_chars) { element.value = element.value.substr(0, max_chars); } } <input type="number" onkey ="limit(this);" onkeyup="limit(this);">

Categories : Jquery

User input: selecting pixel (point) in a video
I'm not sure you can record the pixel position as much as your mouse pointer position. That I know it can be obtained and probably store in a variable for later use.About the frame by frame animation, I assume it may depend of the video player capabilities of each user, and not sure you can guarantee the same experience on every single browser. sorry

Categories : Matlab

Pass One Input Value Into Input Type Hidden Value When User Submits
I would first suggest you give your HTML some IDs like so: <form id="signup" method="post" action="https://go.reachmail.net/libraries/form_wizard/process_subscribe.asp" > <input type='text' name='rm_accounts' id='rm_accounts' value='' /> <input type="hidden" name="page_confirm" id="page_confirm" value="http://www.mywebsite.com/index.php?rm_accounts="> <input type="submit" name="Submit" value="Submit" > </form> Then use some jQuery for your task: $('#signup').submit(function(){ var value = $('#rm_accounts').val(); var page_confirm = 'http://www.mywebsite.com/index.php?rm_accounts='+value; $('#page_confirm').val(page_confirm); });

Categories : PHP

Android activity exception rises wen i click on proceed widout selecting a image from grid using checkbox..want to handle exception
Add this to your onClick method under the proceed button. if (checkbox.isChecked()){ //do something }else{ //call the method you want to execute when check box is not selected } Otherwise a simple try catch statement should do the trick. You can add your method to the catch so that it will be executed when an exception is caught.

Categories : Android

Selecting the first tag of a certain type in multiple levels of other tags
What you're trying to do is impossible with CSS3 selectors. first-of-type and first-child etc. are relative to their direct parent.

Categories : HTML

LINQ throwing TypeAs expression with input of type 1 and check of type 2 is not supported
Unfortunately, you're going to have to do this dynamically. Generics (combined with Entity Framework's apparent fear of typecasting) won't allow you to write the code you want in a static manner. So try this instead: using System.Linq.Expressions; public static Expression<Func<TEntity, bool>> DefaultFilter<TEntity>() where TEntity : IEntity { if (typeof(SoftDeleteEntity).IsAssignableFrom(typeof(TEntity))) return DefaultFilterSoftDelete<TEntity>(); else return x => true; } public static Expression<Func<TEntity, bool>> DefaultFilterSoftDelete<TEntity>() where TEntity : IEntity { var parameterExpression = Expression.Parameter(typeof(TEntity)); var propertyExpression = Expression.Property(parameterExpression, "

Categories : C#

jQuery - selecting all the text in an input field closes the form
I would try this (replacing mouseover on document by click) : $(document).on('click', function (e) { if ($('#log-in').has(e.target).length === 0) { $('#log-in').fadeOut(200); $('#aLogin').show(); } }); But it's hard to be sure if it's good without seeing the HTML too

Categories : Jquery

ZF1: Add input type as class to tag wrapping input field
Just override render method: class My_Form extends Zend_Form { public function loadDefaultDecorators($disableLoadDefaultDecorators = false) { //Set the decorators we need: $this->setElementDecorators(array( 'ViewHelper', 'Errors', array('Description', array('tag' => 'p', 'class' => 'description', 'escape' => false)), array('decorator' => array('Div' => 'HtmlTag'), 'options' => array('tag' => 'div', 'class' => 'element')), array('Label', array('escape' => false)), array('decorator' => array('Li' => 'HtmlTag'), 'options' => array('tag' => 'li')), )); } public function render(Zend_View_Interface $view = null) {

Categories : PHP

Angular validate input type="email" as type="text"
I don't think it's possible to change how input type='email' is handled in angular without changing it's source, but maybe instead you could try to: <input type="text" required late-email /> angular.module('yourApp').directive('lateEmail', function () { return { priority: -1, link: function(scope, elem, attrs) { elem.attr('type', 'email'); } }; }); Important thing here is priority, as angularjs input directive needs to run(link) first so will use 'text' as input type, then lateEmail will change input type to email.

Categories : Javascript

Assign ViewBag value to input checkbox?
I recommend using this, assuming you are using Razor: @Html.CheckBox("chkSolicitation", (bool)ViewBag.Solicitation) If you are not using Razor, use this: <%: Html.CheckBox("chkSolicitation", (bool)ViewData["Solicitation"]) %>

Categories : Asp Net Mvc

How to change the name of input checkbox with jQuery?
If you want to name your inputs using their id, then you can do $('input[name="INPUT_NAME"]').attr('name', function(){ return 'INPUT_NAME['+ this.id +']' }); But really, there is no good reason I can imagine to do such a thing.

Categories : Jquery

Eternicode Bootstrap datepicker selecting input behind on touch Andriod Webkit< 534
Workaround Extended the datepicker javascript to inject the datepicker relative to the source element. This will push surrounding elements away from the datepicker eliminating the selection issue Javascript Snippets if (this.element.hasClass('datepicker-relative')) { //relative datepicker this.isRelative = true; } Build if (this.isInline) { this.picker.addClass('datepicker-inline').appendTo(this.element); } else if (this.isRelative) { this.picker.addClass('datepicker-relative datepicker-dropdown dropdown-menu').appendTo(this.element.parent()); } else { this.picker.addClass('datepicker-dropdown dropdown-menu'); } CSS .datepicker-relative{ position: relative; top: 0;left: 0;right: 0;bottom: 0; font-size: 14px;}

Categories : Javascript

Jquery input checkbox & radio - not working
Always check the javascript console of your browser. It is your friend. In your example I see an error telling me Uncaught Error: Syntax error, unrecognized expression: [name=option[218]] that is caused by this expression $('input[name='+input.attr('name')+']') If the name value is different from a simple name (in your case it is option[218]) then you have to use extra quotes around the value. So change your code to $('input[name="'+input.attr('name')+'"]') and the error is gone.

Categories : Jquery



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.