![]() |
Js
Hi! I want to transfer the value of text box (name_txt) into variable var1, but there is some error. Please! Help me out.
<script language="javascript" type="text/javascript" > <!-- function my() { var var1; var1=document.getElementsByName(name_txt); document.write(var1); } --> </script> <input id="Text1" type="text" name="name_txt" /> <input id="Button1" type="button" value="button" onclick="my()"/> </div> Thanx |
Re: Js
Try this
var1=document.getElementsByName("name_txt"); |
Re: Js
Same error occurs again.... when i type in txtbox and click button
error:A runtime error has occurred" Please! chk my code HTML Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="tax.aspx.cs" Inherits="tax" %> |
Re: Js
This works fine for me
HTML Code:
<script language="javascript" type="text/javascript" > |
Re: Js
Please check this code again....
"Undefined" is coming instead of "name_txt" value, when in browser. |
Re: Js
which browser ?
|
Re: Js
I am using Internet Explore 6 and Mozilla Firfox.
It's not working in anyone of them. and return "undefined" |
Re: Js
Code:
<script language="javascript" type="text/javascript" > |
Re: Js
Sorry! same results "Undefined".
I have check this code on many PCs, but same results appear. document.write(var1);//////this line is working fine Through this code, i want to take input using Javascript and an HTML textbox. I think there is something else, which is missing in this code. |
Re: Js
Try using getElementsById then and see ?
|
| All times are GMT +5.5. The time now is 15:51. |