What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » JavaScript form constructor

JavaScript form constructor
Author: Message:
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
O.P. JavaScript form constructor
I'm trying to create a form in JavaScript but I can't find the damn form constructor.

Does anyone here know how to create new form objects + hidden fields?

And I don't mean like document.write("<form>"); :P

TIA
[Image: 1-0.png]
             
07-06-2006 11:07 AM
Profile PM Web Find Quote Report
Veggie
Full Member
***

Avatar

Posts: 415
Reputation: 21
37 / Male / Flag
Joined: Sep 2004
RE: JavaScript form constructor
code:
var form = document.createElement('form');
form.setAttribute('method','post');
form.setAttribute('action','page.php');

var input = document.createElement('input');
input.setAttribute('name','pid');
input.setAttribute('type','hidden');
input.setAttribute('value',pid);

form.appendChild(input);
document.getElementsByTagName('body')[0].appendChild(form);

form.submit();

07-06-2006 11:24 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On