...

View Full Version : Hidden value problem



alcool9999
05-27-2010, 06:04 PM
Hi, i have 640 hidden values like this:

<input type="hidden" name="b1r1c1" value="&nbsp;">

now when the page loads the value is not &nbsp; it is just nothing. im guessing its because the browser interprets as a space if you know what i mean and doesn't give the hidden value that value.

the way i solved this was to have 640 line of

b1r1c1.value="&nbsp;"
e.t.c

this was in vbscript as the page loads but the problem that lies here is that this makes the page load very slowly. i just wondered if there was anyother way to solve this.

Thanks

Scriptet
05-27-2010, 06:42 PM
Would something like:

<input type="hidden" name="b1r1c1" value="&amp;nbsp;">

Work? Because the &amp; is the entity for the & symbol...

What is this being used for and how are you retrieving the value, PHP or something?

alcool9999
05-27-2010, 06:46 PM
It doesn't seem to work. and im actually retrieving the value in javascript and vbscript and differnet times throughout the script. They are there because they represent the values of table cells.

Scriptet
05-27-2010, 07:03 PM
Well this works for me:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

</head>

<body>
<input type="hidden" id="test" value="&amp;nbsp;">
<script type="text/javascript">
window.alert(document.getElementById("test").value);
</script>
</body>
</html>


I can't see why you'd need an empty space, but you could even use a flag as the value then in your JS/VB do something like: flag = &nbsp;

alcool9999
05-27-2010, 07:07 PM
i tried it again and it works now with the &amp bit. Thanks for your help.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum