Skip to content

How to add hidden fields to form and submit with Javascript

In HTML Code:

<form action='myScript.php' method='get' name='myForm'>

Javascript code:

var form = document.forms['myForm'];
// form.action = 'put your url here';
var na = document.createElement("input");
na.type = "hidden"; = "name";
na.value = "Bob The Builder";



Published inPHP/JS/MySQL Scripting

Be First to Comment

Leave a Reply

%d bloggers like this: