Buy My Account


Basics
Overview
Easy Code Customization
Sample Applications
Video Demos
Customers
Free Training
Pricing & Ordering
Download Now!

Product Tour
Product Tour
Web & Cloud Applications
Mobile Applications
SharePoint Applications
Charts and Reports
Security
Team Development
What's New in V11.0

Technical Materials
Training Courses
Online Help
Technical Forums
White Papers
One Day Web Apps E-book
System Requirements
Product Roadmap
Version History
Iron Speed Technical Forums
Register New Posts Chat
 
 
 


Reply
 
Author Comment
 
janice

Registered: 05/21/05
Posts: 40
Reply with quote  #1 

Hi,

I have a textbox as below:

 

 

Once the value of this textbox is changed, it will trigger some events. Hence, i set the attributes of this textbox to:

 

      name: OnChange

      value: javascriptLEAVEValidate();

 

I add in the following code in my html:

 

 function DLEAVEValidate()

{

   alert(window.document.getElementById("V_DLEAVE").value);

}

Unfortunately, the above codes causes javascript error.

 

how can i get the value of a textbox, literal, label and other controls using javascript ???

 

* Sorry, can pls resend ur reply ? even it stated there are 2 reply, but i can't read any message reply !! Sorry for inconvenienve ! thanks !!

 

akeshgupta

Avatar / Picture

Iron Speed MVP
Design, Develop & Deliver

Registered: 04/25/04
Posts: 4,817
Reply with quote  #2 
Janice:

Take a look at the attached html file. It should give you some ideas. I found it on the web.

Code:


Test Input

function testResults (form) {
var TestVar = form.inputbox.value;
alert ("You typed: " + TestVar);
}
function validate (form) {
var TestVar = form.inputbox.value;
alert ("You typed: " + TestVar);
}



Enter something in the box:







Thanks.


__________________
Akesh Gupta
Light Speed Solutions, LLC.
If I rest, I will rust !   Let's share the knowledge !
akeshgupta

Avatar / Picture

Iron Speed MVP
Design, Develop & Deliver

Registered: 04/25/04
Posts: 4,817
Reply with quote  #3 
Janice:

It seems that I did not add the code tag.  Try this one.

Code:



Test Input



Enter something in the box:







Thanks.


__________________
Akesh Gupta
Light Speed Solutions, LLC.
If I rest, I will rust !   Let's share the knowledge !
janice

Registered: 05/21/05
Posts: 40
Reply with quote  #4 

Hi ,

I have tried the method u provided in last reply. Unfortunately, it still cannot work. It returns an error: 'DLEAVE.value' is null or not an object

it returns the same error if i used 'V_DLEAVE.value'

 

In my application, there is a textbox as follow:

  

 

Here is the code i wrote in my javascript (same as ur reply)

----------------------------------------------------------

function DLEAVEValidate(form)

{

      alert(form.DLEAVE.value);

      // OR

      alert(form.V_DLEAVE.value);

}

--------------------------------------------------------

 

Is it failed to find the textbox object ? If YES, how should i called the textbox ? Any others ways to get the value of the control in my application ??

 

Thanks n Best Regards !!

 

 

 

 

 

CarlK

Registered: 02/17/05
Posts: 368
Reply with quote  #5 

Janice, you need to use the full address of the control to call it in javascript.

Such as below. My text box is Cost_Per_Person. AS you can see I had to use the tblABudget_ItemRecordControl prefix to the text box control.

 

var zvar=(document.Form1.tblABudget_ItemRecordControl_Cost_Per_Person.value) 

 

Hope it helps.

 

Carl 

zaggaustralia

Registered: 06/22/10
Posts: 1
Reply with quote  #6 
thank you for this nice post
it's relay helpful to me.
webdesign

Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Download Iron Speed Designer
   
 

Terms of Service Privacy Statement
Powered by Website Toolbox - Create a Website Forum Hosting, Guestbook Hosting, or Website Chat Room for your website.