kabucek Posted January 16, 2009 Share Posted January 16, 2009 hi can we setup hidden values to textbox? like options for select? thanks Quote Link to comment Share on other sites More sharing options...
Maq Posted January 16, 2009 Share Posted January 16, 2009 Yeah, why not? Have you tried it and failed? Quote Link to comment Share on other sites More sharing options...
kabucek Posted January 16, 2009 Author Share Posted January 16, 2009 yes, I've tried and its displaying the option next to the textbox as words, which is not what I want. thanks Quote Link to comment Share on other sites More sharing options...
mojopanel Posted January 17, 2009 Share Posted January 17, 2009 There many ways,. text boxes display content entered into them. Are you trying to hide information entered into a text box and save it off in a hidden var somewhere? If so, you could probably do something like this on a key down event of a textbox. <script> function hideText(obj) { hiddenField = document.getElementById("myHiddenField"); hiddenField.value += obj.value; obj.value = ""; } </script> & First off, options for select aren't hidden. They are the things that actually get shown. You could use a hidden field <form action="#" method="POST"> <input type="text" name="textBox" /> <input type="hidden" name="hiddenName" value="someValue" /> <input type="submit" value="Submit" /> </form> Quote Link to comment Share on other sites More sharing options...
kabucek Posted January 19, 2009 Author Share Posted January 19, 2009 i want to have textbox ( i think the idea is similar to a login box) where someone will type in date (ex. Feb 2) if Feb 2 is one of the values (1 - jan 2 2 - feb 2 3 - jul 6 ) then form will know in the next page of code that the value of the texbox is feb 2, which is code 2 thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.