473,320 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

submiting to cgi, without an html file

Hey guys (and girls ;)),

I want to create some form data and submit
it to the cgi script without having any (DOM) document loaded up. Is there a
way in jscript to say... (probably something like...)

var myFormObject = new document(actionHref, encryptType, etc...,
nameOfFormField, valueOfFormField, etc...);

myFormObject.submit();

I could always write a litle html file with a body of hidden fields and set
thier values (ie: window.chathtm.form.field = whatever), but i don't really
want the overhead of downloading the extra page... ok, that's
a lie... i'm anal and just want to not load the htm file ;)

So all i want is to submit a form (and it's data) to a cgi script, using
jscript, without actually having an html file (it's from a frame based so
the
jscript is running from the top window, and the cgi script is in a frameset
window)

Jul 23 '05 #1
2 1745
I don't know anything about JScript so I'm going to assume javascript.
You can create an internal form element, and then populate it
in turn with <input type=hidden fields ...> for each of the name/value
pairs that you want. I'd make a variable argument function:
constructInternalForm (method, action, target, name1, val1, name2, val2,
....)
which returns the form object, then just submit it.
In case you haven't done it before, down near the bottom of the page
on http://www.devguru.com/Technologies/.../obj_node.html
you can see a list of useful methods by which to construct your internal
form
(the appendChild doesn't quite match the way I use it).

Csaba Gabor
PS. Here's a starter kit,

<BODY id=myBod>
<SCRIPT type='text/javascript'>
var myBod = document.getElementById('myBod');
var myForm = document.createElement("FORM");
myForm.id = "internalForm";
myForm.target = "iframeName";
myForm = myBod.appendChild(myForm);
var myInput = document.createElement("INPUT");
myInput.name = "firstName";
myInput.type = "hidden";
myInput.value = "Hi Mom";
myForm.appendChild(myInput);
alert(document.getElementById('internalForm')[0].value);
</SCRIPT>
</BODY>

"Robert Diamond" <-r***@anti.spam.com> wrote in message
news:e3******************@news04.bloor.is.net.cabl e.rogers.com...
Hey guys (and girls ;)),

I want to create some form data and submit
it to the cgi script without having any (DOM) document loaded up. Is there a way in jscript to say... (probably something like...)

var myFormObject = new document(actionHref, encryptType, etc...,
nameOfFormField, valueOfFormField, etc...);

myFormObject.submit();

I could always write a litle html file with a body of hidden fields and set thier values (ie: window.chathtm.form.field = whatever), but i don't really want the overhead of downloading the extra page... ok, that's
a lie... i'm anal and just want to not load the htm file ;)

So all i want is to submit a form (and it's data) to a cgi script, using
jscript, without actually having an html file (it's from a frame based so
the
jscript is running from the top window, and the cgi script is in a frameset window)

Jul 23 '05 #2
Sweet, just what i was looking for, thanks, would have been lost without
this ;) Time for coffee though, then back to the script ^.~
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bartosz Wegrzyn | last post by:
Please look at my code. I do validation of my form before I submit it. I want to be able to to press one form button without running validating script. I just want to go directly to my php...
1
by: Pat | last post by:
Here is how I have been submiting a form to a popup window, this works fine for all netscape versions and all IE versions previous to 6.0.2800.1106. Does anyone know a different way I can submit a...
6
by: Abby Lee | last post by:
I have a for statement in my validation process I do a for loop becasue I don't know how many rows of items there are...I need to validate each item in each row. If I remove the...
2
tolkienarda
by: tolkienarda | last post by:
hi i am trying to call a php function called "select". so far i have <form action="select" method="post"> the function is in the head of the html document. here is the entirety of the form. I...
0
by: pankaj1703 | last post by:
i am create one enquiry form after submiting the information fillup by the end user then it get thanks message. if it press back button it go to the enquiry form fill by him that i want to prevent...
0
by: Roland | last post by:
Hello! Firstly, sorry for my poor English... :/ Next, I want to show you my library dll - HttpClient. This library can: - get page - submit form - download and upload file (you can monitor for...
2
by: blitzztriger | last post by:
Hello!! how do i insert values into mysql , after parsing a submiting textbox?? I made the arrays, so this should be a basic insertion of them in the db, but something is missing, or in the wrong...
5
by: rodrigo21 | last post by:
I have a form that submits the form values to the same page (of the form). The database is feed from the same page that have the form in it. So the action attribute would look like this <form...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.