473,624 Members | 2,510 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hidden value becomes null

I have this on a web page

<input type='hidden' name ='military' value=1>

and this in a javascript function:
alert(document. form1.military. value);
The military value comes up null.

Is this normal, or did I do something wrong ?

thanks, meltedown
Jun 1 '06 #1
4 1708
VK

meltedown wrote:
I have this on a web page

<input type='hidden' name ='military' value=1>

and this in a javascript function:
alert(document. form1.military. value);
The military value comes up null.

Is this normal, or did I do something wrong ?


It is not really normal. Could you post more complete code fragment? An
URL would be super.

Jun 1 '06 #2
VK wrote:
meltedown wrote:
I have this on a web page

<input type='hidden' name ='military' value=1>

and this in a javascript function:
alert(document. form1.military. value);
The military value comes up null.

Is this normal, or did I do something wrong ?


It is not really normal. Could you post more complete code fragment? An
URL would be super.


Ok thanks, I must have done something wrong. I can't post the url with
the problem, but I made this exmaple, which does work.
http://reenie.org/test/test28.php
Jun 1 '06 #3
meltedown said the following on 6/1/2006 1:15 PM:
VK wrote:
meltedown wrote:
I have this on a web page

<input type='hidden' name ='military' value=1>

and this in a javascript function:
alert(document. form1.military. value);
The military value comes up null.

Is this normal, or did I do something wrong ?


It is not really normal. Could you post more complete code fragment? An
URL would be super.


Ok thanks, I must have done something wrong. I can't post the url with
the problem, but I made this exmaple, which does work.
http://reenie.org/test/test28.php


It is amazing what happens when people make test cases and they work.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 1 '06 #4
Randy Webb wrote:
meltedown said the following on 6/1/2006 1:15 PM:
VK wrote:
meltedown wrote:
I have this on a web page

<input type='hidden' name ='military' value=1>

and this in a javascript function:
alert(document. form1.military. value);
The military value comes up null.

Is this normal, or did I do something wrong ?

It is not really normal. Could you post more complete code fragment? An
URL would be super.


Ok thanks, I must have done something wrong. I can't post the url with
the problem, but I made this exmaple, which does work.
http://reenie.org/test/test28.php


It is amazing what happens when people make test cases and they work.

Yeah, it turns out I had tested for NULL in the javascript and used =
instead of ==. Its those simple stupid mistakes that make me question my
understanding. It can't be doing that !!
Jun 1 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
4890
by: Anna | last post by:
Hi all, I posted the same question this afternoon but my message isn't showing up, so I thought I'd give it another try.... in case you should see it later I apologize for posting the same question twice! Here it is: I am having problems reading the value of a text Node. I think it has to do with the fact that the text is in a <span> tag. I have a table and in each <td> I have text + a checkbox. I want to retreive the text next to the...
0
2723
by: yurps | last post by:
Hello here is my html, if you click the missing image in the first column on the left, the div is shown, when clicked again the div disappears...but the bottom border disappears as well...Is there anyway to stop this...??? <HTML> <HEAD> <title>Conform Inbox</title> <meta content="False" name="vs_snapToGrid">
6
2996
by: Omar | last post by:
Hi, In a JSP I have the next: .... codigo = "<select name='" + nombre + "'>\n<option selected value='default'>Escoge</option><option value='todos'>Todos</option>"; if (miRS != null) while (miRS.next()) {
3
1477
by: Microsoft_Public | last post by:
All I'm getting is <null>...... I have a legacy input form that I must maintain for a few more months until the balance of the site can be converted to .Net. I need the one database field to contain either 0, 1, 2. The form has 2 pairs of radio button fields. If the answer to the first Q is Yes value = 1
19
10534
by: k.karthikit | last post by:
Hello all, In some hidden variable (<input type="hidden" name="hiddenId" value="test" /> ,i stored some value.I accessed the value "test" using var id = document.getElementById( 'hiddenId' ); It is working fine in IE. But in Mozilla Firefox , null value is returned.Is there any way to use hidden variables compatible to browsers......?
5
6843
by: james.calhoun | last post by:
I feel like this should be really easy... I want a hidden field in a form to have its value defined when someone clicks on a link. So if they click on link "A" the value of the hidden field becomes "A", while if they click "B" the value of hidden field becomes "B" Help?
4
7237
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which - "Modified" of type DateTime - is hidden since it should not be edited by a user. The system handles the update for this column. So, I have hidden (Visible=false) this column on the grid. In order to access the value in this field, I have created a...
6
2061
by: dba | last post by:
using the following code with a problem.... echo "<input type='hidden' name='member_id' value=\"{$row}\">{$row}"; echo "<input type='radio' name='member_name' value=\"{$row}\">{$row}<br />"; The post_data.php program posts the following member id is: 0009
3
1223
by: JCCDevel | last post by:
Hi All, I'm not too proficient in Javascript but am trying to help a friend out. Bascially, the page we are having trouble with is loaded with a numerical value in the url string. Example: http://www.webpage.com/v4/payment_pg.php?FeeCalcTotalDecimal%20=49.50 I then parse the string to get the total. I then want to assign the value to a hidden form value
0
8231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8672
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8614
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8330
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2603
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1474
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.