Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2009
    Posts
    84
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Hidden value problem

    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

  • #2
    Regular Coder
    Join Date
    Apr 2008
    Posts
    685
    Thanks
    15
    Thanked 105 Times in 104 Posts
    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?

  • #3
    New Coder
    Join Date
    Aug 2009
    Posts
    84
    Thanks
    10
    Thanked 0 Times in 0 Posts
    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.
    Last edited by alcool9999; 05-27-2010 at 06:55 PM.

  • #4
    Regular Coder
    Join Date
    Apr 2008
    Posts
    685
    Thanks
    15
    Thanked 105 Times in 104 Posts
    Well this works for me:

    Code:
    <!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;

  • Users who have thanked Scriptet for this post:

    alcool9999 (05-27-2010)

  • #5
    New Coder
    Join Date
    Aug 2009
    Posts
    84
    Thanks
    10
    Thanked 0 Times in 0 Posts
    i tried it again and it works now with the &amp bit. Thanks for your help.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •