events OnChange with CodeCharge

OnChange berfungsi untuk merubah nilai value dari sebuah textbox ketika textbox yang lain berubah nilai

ilustrasi :

ada sebuah form bernama NewRecord1, di dalamnya terdapat textbox1 dan listbox1

nilai dari textbox1 akan berubah otomatis ketika nilai listbox1 berubah…

function employeeleave_id_OnChange()
{
var result = true;
var jumlah = document.NewRecord1.TextBox1.value;
var jenis = document.NewRecord1.ListBox1.selectedIndex;

document.NewRecord1.TextBox1.value = (jumlah – jenis);
return result;
}

di bawah ini adalah script lebih custom…..

<!–
//End Include Common JSFunctions

//NewRecord1ListBox1_OnChange @3-CE96F29C
function NewRecord1ListBox1_OnChange()
{
var result = true;
//End NewRecord1ListBox1_OnChange

//Custom Code @8-2A29BDB7
var jumlah = document.NewRecord1.TextBox1.value;
var jenis = document.NewRecord1.ListBox1.selectedIndex;

document.NewRecord1.TextBox1.value = (jumlah – jenis);
var jenis = document.NewRecord1.ListBox1.disabled = true;
//End Custom Code

//Close NewRecord1ListBox1_OnChange @3-BC33A33A
return result;
}
//End Close NewRecord1ListBox1_OnChange

//NewRecord1TextBox1_OnChange @7-11B1EC37
function NewRecord1TextBox1_OnChange()
{
var result = true;
//End NewRecord1TextBox1_OnChange

//Custom Code @9-2A29BDB7
document.NewRecord1.ListBox1.disabled = false;
//End Custom Code

//Close NewReco

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s