Solved

How do I read the value of a non HTML textbox from JavaScript?

Posted on 2004-08-18
5
173 Views
Last Modified: 2010-04-07
Hi All,

I'm trying to read the value of the textbox called TextBox1 and pass it as follows

<INPUT title="Button" style="Z-INDEX: 115; LEFT: 832px; POSITION: absolute; TOP: 176px"
                        onclick="showAnimation(TextBox1);" type="button" value="Button">

function showAnimation(file) { if (file != '') {
                  WinName = toString(file)
                  alert(WinName)
                  popup(file ,100,100,500,300,file,false,false,false,false,false,true,false);

            }

The popup function is already working, but the "file" parameter in showAnimation is not getting passed.  It should be the Text value of TextBox1.

B-

0
Comment
Question by:bczingo
[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
5 Comments
 
LVL 2

Expert Comment

by:vijay_a73
ID: 11834829
try TextBox1.value
or document.all.TextBox1.value

I believe your function showAnimation() takes the value of textbox as parameter
0
 
LVL 1

Expert Comment

by:steve_mick972
ID: 11834982
Form1.TextBox1.value OR document.all.TextBox1.vale working in my case....

HTH,
Steve...
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11836943
Hi there,

<INPUT title="Button" style="Z-INDEX: 115; LEFT: 832px; POSITION: absolute; TOP: 176px"
                    onclick="showAnimation();" type="button" value="Button">

function showAnimation() { if (file != '') {
               file=document.getElementById('TextBox1').value;
               WinName = toString(file)
               alert(WinName)
               popup(file ,100,100,500,300,file,false,false,false,false,false,true,false);
          }
         
-Baan
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11836955
sorry... about that...
function showAnimation() {
               file=document.getElementById('TextBox1').value;
               if (file != '') {
               WinName = toString(file)
               alert(WinName)
               popup(file ,100,100,500,300,file,false,false,false,false,false,true,false);
          }
   }
0
 
LVL 10

Accepted Solution

by:
jnhorst earned 500 total points
ID: 11855786
Your INPUT tag has an attribute named "title".  I am not sure that is correct.  It should be:

<INPUT id="Button" name="Button" style="{your style settings}" onclick="showAnimation();" type="button">

Baan's code above for getting the file then is right, just make sure the string in getElementById(...) is the same as the string in the id="..." attribute of the INPUT tag.  You had "value='Button'", which would have the word Button in the textbox.  I think (as stated by others above) that this should be the filename af the animation, so I don't think you want to preset that value in the HTML.

John
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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

707 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