CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 How to reference a form control client-side with JScript?

Print topic Send  topic

Author Message
favc4

Posts: 30
Posted: 06/20/2006, 1:14 AM

Hi again! I made this cheesy function to respond to an onchange event in one form's listbox control

//page_rcCallDetail_IdResultadoLlamada_OnChange @10-372E206E
function page_rcCallDetail_IdResultadoLlamada_OnChange()
{

var IdRLL = document.forms["rcCallDetail"].IdResultadoLlamada.Value;
var result = null;
alert("Variable='IdRLL' value="+IdRLL)

switch (IdRLL)
{
case 1: result = 2; break;
case 2: showDatePicker('rcCallDetail_DatePicker_hFechaProximoContacto1','rcCallDetail','hFechaProximoContacto'); result="Pasaba x aki";
default: result = 'unknown';
}

//End page_rcCallDetail_IdResultadoLlamada_OnChange

//Close page_rcCallDetail_IdResultadoLlamada_OnChange @10-BC33A33A
return result;
}
//End Close page_rcCallDetail_IdResultadoLlamada_OnChange

The issue is that var IdRLL is getting undefined; this is supposed to get the control current value, isnt so?
_________________
Programming win32 and went crazy...
View profile  Send private message
Edd


Posts: 547
Posted: 06/20/2006, 5:04 AM

I think the syntax for getting a value of a listbox is:
  
var IdRLL	= document.forms["rcCallDetail"].[[document.forms["rcCallDetail"].selectedIndex].value;  

You need the index of the selected item in the listbox first.

Hope this helps

Edd

_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.