Jump to content

JavaScript: passing hidden input feild to variable & writing it out?


justravis

Recommended Posts

i am trying to pass the value of the req feild to reqfeilds

req writes OK, but reqfeilds does not.

thoughts?

 

THANKS!

 

<html>
<head>
<script type="text/javascript">
function getValue()
{
document.write(document.getElementById('req').value + '<br>');
        var reqfeilds = document.getElementById('req').value;
document.write(reqfeilds + '<br>');
}
</script>
</head>
<body>

<input type=hidden id=req value='name,email'>
<input type=button id=split value=split onclick="getValue()">

</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.