javascript: assign textbox value to variable


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: javascript: assign textbox value to variable

Hybrid View

  1. #1
    Jeff Guest

    javascript: assign textbox value to variable


    I have a javascript function where I assign the value of a textbox to a variable.
    I have no problem in IE 4 but Nescape 4.x says there is a javascript error.


    The line is:

    my_parm = thisForm.txtNDC.value;

    But if I place the literal like this, it works:

    my_parm = "7007";


    What am I doing wrong?



  2. #2
    Carl Cirillo Guest

    Re: javascript: assign textbox value to variable


    It makes a different where in the page your trying to assign that variable
    in relation to where the form itself is (on the same page, in a different
    frame, etc).

    In general though, Netscape likes to see the document. qualifier before the
    form name. So try my_parm=document.thisForm.txtNDC.value;

    If this doesn't work, then provide some more details about how the page and
    form are setup or the actual code from the page.

    -carl

    "Jeff" <jeffm@earthlink.net> wrote:
    >
    >I have a javascript function where I assign the value of a textbox to a

    variable.
    >I have no problem in IE 4 but Nescape 4.x says there is a javascript error.
    >
    >
    >The line is:
    >
    >my_parm = thisForm.txtNDC.value;
    >
    >But if I place the literal like this, it works:
    >
    >my_parm = "7007";
    >
    >
    >What am I doing wrong?
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center