making text info hidden on a web page

Hi i have a text box 1) and i have text or data
2) this i am placing on the page that i wish to refer back to which is not a text box but want to put on the page for future ref
but cannot figure out how to hide
any help would be appreciated

1) <input type="hidden" name="itemid_<?php echo ($i);?>" value="<?php echo $item->id; ?>" />

********** this is what i need to reference but need to be
2) <td width="0%" align="right">
                        <span  id="Stockpres_<?php echo ($i);?>" class="tablchet" ><?php echo $item->amount;?></span>      
                  </td>

this does not work
3) <td width="0%" align="right">
                        <span type="hidden" id="Stockpres_<?php echo ($i);?>" class="tablchet" ><?php echo $item->amount;?></span>      
                  </td>
sydneyguyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
chaauConnect With a Mentor Commented:
You do not need to use type="hidden", as it applies to input only. For span, "hidden" is an actual attribute. Therefore change it to
<span hidden id="Stockpres_<?php echo ($i);?>" class="tablchet" ><?php echo $item->amount;?></span>   

Open in new window

0
 
Scott Fell, EE MVEDeveloperCommented:
Why wouldn't you just create another hidden input field for that value?
0
 
Scott Fell, EE MVEConnect With a Mentor DeveloperCommented:
I think it may be the language barrier, but I thought you wanted the data to carry over to the next page perhaps via a get via the form.  That is why I suggested.
0
 
sydneyguyAuthor Commented:
<span hidden id="Stockpres_<?php echo ($i);?>" class="tablchet" ><?php echo $item->amount;?></span>  

works fine thanks for that
i do not need to pass this value across, and i wanted to findout how to do it you never know when i could use this in another situation

thabks for all you help
0
 
Dave BaldwinFixer of ProblemsCommented:
I've done things like that so I could look at the HTML source code for info I didn't want shown on the visible page.  Mostly test data so I could see why the visible page was working as it was.
0
All Courses

From novice to tech pro — start learning today.