Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to retrieve values from a textbox

Posted on 2000-05-03
4
Medium Priority
?
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

604 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