



Trailer
function donFonksiyon() {
$.each($("input:text", document.forms[0]), function() {
alert(this.id);
}, null);
}
$("select").change(
function()
{
var SelectIdsi = this.id;
var selectedIndex = this.selectedIndex;
var seciliText = this.options[this.selectedIndex].text;
var seciliValue = this.value;
});
$('#select').selectOptions('secilecekOptionValue');
/* get the value from a dropdown select */
$('select#foo option:selected').val();
/* get the value from a checked checkbox */
$('input:checkbox:checked').val();
/* get the value from a set of radio */
$('input:radio[name=bar]:checked').val(); buttons
/* CheckBox ya da Radio seçiliyse değerini getir:
$("#rbCB:checked").val()
/* Radio seçilmiş mi?
$("#rbCB").is(":checked");
/* Using Name for selector */
$("input[@name='chkBox']").click(function(){
// your code here
});
/* Using ID for selector */
$("#chkBox").change(function(){
// your code here
});
Radio Button:
<input name="rdio" value="a" checked="checked" type="radio">
<input name="rdio" value="b" type="radio">
<input name="rdio" value="c" type="radio">
Handling change event for Radio buttons:
Click event can be handled similarly. ID can not be used here because Radio buttons are used for single selection from a group where all input fields of group should have same name.
$("input[@name='rdio']").change(function(){
if ($("input[@name='rdio']:checked").val() == 'a')
// Code for handling value 'a'
else if ($("input[@name='rdio']:checked").val() == 'b')
// Code for handling value 'b'
else
// Code for handling 'c'
});
/// <summary>
/// Cem - ExecuteDataTable da olsun.
/// </summary>
/// <param name="cmd"></param>
/// <returns></returns>
public virtual DataTable ExecuteDataTable(DbCommand cmd)
{
DataTable dataTable = new DataTable();
using (ConnectionWrapper wrapper = GetOpenConnection())
{
cmd.Connection=wrapper.Connection;
using (DbDataAdapter dbDataAdapter = GetDataAdapter(UpdateBehavior.Standard))
{
((IDbDataAdapter)dbDataAdapter).SelectCommand = cmd;
dbDataAdapter.Fill(dataTable);
}
}
return dataTable;
}