Tech-Today
Select All CheckBox or Element in a Form HTML
Creating a form dynamically at run time – this also means we should give unique names to each html controls. For example we have a datagrid like object and its first column is checkbox, how should we check all of the rows.
Here is my code that iterates to all controls in an html document and check if it is CheckBox type:
//flag can have the value of 1 = checked, else unchecked
function checkAll(flag) {
var f = document.forms["yourformname"], i;
for(i = 0; i < f.length; i++){ //iterate to each control
if(f[i].type == 'checkbox'){ //if type checkbox
if(flag == 1)
f[i].checked = true;
else
f[i].checked = false;
}
}
}
-
How To Handle Checkbox Event In Swift
A very simple checkbox control. @IBAction func btn_box(sender: UIButton) { if (btn_box.selected == true) { btn_box.setBackgroundImage(UIImage(named: "box"),...
-
Add A Jquery Datepicker On Jquery Dialog Box Via Load Method
Recently I've worked on a form that requires a jquery datepicker to be rendered inside jquery's dialog element. Where I encountered several problems like: 1.) datepicker() should be invoke inside dialog 2.) the dialog created (div) should be remove...
-
Validation-summary-errors Div Showing Even If There Is No Error Binded To A Property
I'm working on a change password form when I encountered this strange behavior from mvc3. I created a simple form and change password model with 3 fields (old, new, confirm password). Then I extended ValidationAttribute to validate the password's...
-
C# Insert Dynamic Html - Html Injection
While creating a plugin for IE, I've encountered several problems like how to create a popup form when a certain condition has been met. And how to add dynamic css and javascript to the document page. What I did. In IE's DocumentComplete method...
-
How To Order The Textboxes In An Html Document By Using Html Tag Tabindex
In Visual Studio TabIndex is a property that is accessible in each control, I thought there was no equivalent in plain html. So what I did was to manually captured the control's (example textbox) onblur event. It was working well until I found a bug,...
Tech-Today