Solved

How to retrieve values from a textbox

Posted on 2000-05-03
4
159 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now