?
Solved

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

Posted on 2004-08-18
5
Medium Priority
?
174 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 1500 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
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 …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

752 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