Solved

How to retrieve values from a textbox

Posted on 2000-05-03
4
162 Views
Last Modified: 2010-04-09
  I have an input box in a form with the name having a dot in it,;i.e; a name like "abc.txt". I want to get the value of this input box in a javascript function. How do I do it?
Thanx in advance,
Divya.
0
Comment
Question by:divya234
4 Comments
 
LVL 1

Expert Comment

by:anyanicky
ID: 2776055
document.myform.element(0).value
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 2780315
you can try this:

document.myform["abc.txt"].value

(I believe this will work)

CJ
0
 

Expert Comment

by:dmatsch
ID: 2781888
Don't expect much of anything without some points...
0
 

Accepted Solution

by:
QBMaster earned 0 total points
ID: 2782059
I'd answer the question even tho there are no points...
it's not a hard question :)
so i'll just answer it right now.



<HTML>
 <HEAD>
  <SCRIPT LANGUAGE="Javascript">
   function GetText()
   {
      var Text=document.Form1.elements["Text.Box"].value;
      alert(Text);
   }
  </SCRIPT>
 </HEAD>
 <BODY>
  <FORM NAME="Form1" ONSUBMIT="GetText();">
   <INPUT TYPE="TEXT" NAME="Text.Box" LENGTH="20">
  </FORM>
 </BODY>
</HTML>


enter the text you want in the box and press Enter.
and it will display a message box with the text from the box in the message box window.

; )
i don't need points to help people.
i just do it cause i can ; )


Willard
AKA QBMaSteR

http://www.arbie.com/
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question