Jump to content

Form Elements


Link

Recommended Posts

see how this works out for you:

 

<script language="javascript">
function grabAll()
{
var theForm = document.getElementsByTagName("input");
for (i=0; i<theForm.length; i++)
{
var max = theForm.length - 1;
if (i == max)
{
var morestuff="";
}
else
{
var morestuff="&";
}
document.getElementById("all").innerHTML += theForm[i].name + "=" + theForm[i].value + morestuff;
}
}
</script>

<form>
<input type="text" name="name1" value="Bob">
<input type="text" name="name2" value="John">
<input type="text" name="name3" value="Bill">
<input type="text" name="name4" value="Tom">
<input type="text" name="name5" value="Greg">
</form>

<br><br>

<span id="all"></span>

<br><br>

<input type="button" name="actionbutton" onclick="grabAll()" value="String'em Together!">

Link to comment
https://forums.phpfreaks.com/topic/92403-form-elements/#findComment-473435
Share on other sites

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.