AyRestaurant Posted January 6, 2011 Share Posted January 6, 2011 I have this input that is hidden ---- I want to have this type="button" (AFTER CLICK) so it that shows that hidden field... any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/223615-show-a-input-typehidden-field/ Share on other sites More sharing options...
shayward2003 Posted January 6, 2011 Share Posted January 6, 2011 what do you want the input field to be shown up as... do you want <input type="hidden".... changed to something like <input type="text".... ? Or do you want a non-visible <input type="text".... to become visable? Quote Link to comment https://forums.phpfreaks.com/topic/223615-show-a-input-typehidden-field/#findComment-1155912 Share on other sites More sharing options...
AyRestaurant Posted January 7, 2011 Author Share Posted January 7, 2011 Hey, Thanx for responding. I want a non visible to be visible. I actually have this: <input type="hidden"> Is it posibble to make it visible with a button click? Or is there any other way to do something similar? Thanx a lot! Quote Link to comment https://forums.phpfreaks.com/topic/223615-show-a-input-typehidden-field/#findComment-1155962 Share on other sites More sharing options...
AyRestaurant Posted January 7, 2011 Author Share Posted January 7, 2011 someone told me to do this: <script type="text/javascript"> function showHidden(id) { alert( document.getElementById(id).value ); //Sorry, yahoo was cutting it off } </script> onclick call this function and send it the id of the hidden input. for example if you had <input type="hidden" id="h" value="show me" /> then your call should look like this <input type="button" value="click me" onclick="showHidden('id')" /> but it does not work... help Quote Link to comment https://forums.phpfreaks.com/topic/223615-show-a-input-typehidden-field/#findComment-1155990 Share on other sites More sharing options...
Philip Posted January 7, 2011 Share Posted January 7, 2011 Look into getAttribute & setAttribute. something like: if(document.getElementById(id).getAttribute('type') == 'hidden') { document.getElementById(id).setAttribute('type', 'text'); } Quote Link to comment https://forums.phpfreaks.com/topic/223615-show-a-input-typehidden-field/#findComment-1156005 Share on other sites More sharing options...
AyRestaurant Posted January 7, 2011 Author Share Posted January 7, 2011 were do i put that code? Quote Link to comment https://forums.phpfreaks.com/topic/223615-show-a-input-typehidden-field/#findComment-1156010 Share on other sites More sharing options...
AyRestaurant Posted January 7, 2011 Author Share Posted January 7, 2011 nvm i found out thnx! Quote Link to comment https://forums.phpfreaks.com/topic/223615-show-a-input-typehidden-field/#findComment-1156080 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.