I have this input that is hidden and I want to show it with a button click.
Someone recommended 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...
someone else told me to add this somewhere:
if(document.getElementById(id).getAttribute('type') == 'hidden') {
document.getElementById(id).setAttribute('type', 'text');
}
neither work... plz help..