473,499 Members | 1,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 1703
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.javascript 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
4868
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...
0
2710
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...
6
2979
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...
3
1470
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...
19
10518
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' );...
5
6828
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...
4
7210
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 -...
6
2045
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 />"; ...
3
1216
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: ...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7220
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...
0
7386
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...
0
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4918
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4599
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...
0
3098
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
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 ...

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.