473,767 Members | 2,198 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(action Href, encryptType, etc...,
nameOfFormField , valueOfFormFiel d, etc...);

myFormObject.su bmit();

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 1764
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:
constructIntern alForm (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.getEle mentById('myBod ');
var myForm = document.create Element("FORM") ;
myForm.id = "internalFo rm";
myForm.target = "iframeName ";
myForm = myBod.appendChi ld(myForm);
var myInput = document.create Element("INPUT" );
myInput.name = "firstName" ;
myInput.type = "hidden";
myInput.value = "Hi Mom";
myForm.appendCh ild(myInput);
alert(document. getElementById( 'internalForm')[0].value);
</SCRIPT>
</BODY>

"Robert Diamond" <-r***@anti.spam. com> wrote in message
news:e3******** **********@news 04.bloor.is.net .cable.rogers.c om...
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(action Href, encryptType, etc...,
nameOfFormField , valueOfFormFiel d, etc...);

myFormObject.su bmit();

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
2803
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 script. I tried to do this onclick="document.form1.submit()" but than the button value is not posted and my php script is not working.
1
1403
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 form to a popup window? ------------------------------------------------ <script language="JavaScript"> function new_window() { // Reference the form in this page
6
1432
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 "document.forms.submit(); it works perfectly...the code stops at each field that is not formated properly...but never submits. However if I leave the submit() in there, the page submits before they have a chance to fix problems. How can I get both to work...
2
2350
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 will need to submit this same form to several different functions throughout the page so that is why i use the method i chose <form method="post" action=<? echo '"', $func, '"'; ?>> <select> <option>asdf</option>
0
1134
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 any solution for this ...
0
1947
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 example how much bytes just downloaded / uploaded, how much bytes remain to end, speed (in KB/ s), progress, time left (time remain) (in seconds) Documentation is in rar file (HttpClient.dll + Documentation.html). Unfortunately the documentation...
2
5882
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 place...can anyone help me?? i didnt made anything in the VALUES (unless the POST ), because i bet the error is there (yes, the arrays are missing): $sql = "INSERT INTO dgplanets ( ID, coords , player name , alliance , name , ground , orbit ,...
5
1889
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 action="samepage.php" Right now, after submiting, the same form opens, so the user dont know if his record was submited. Saying this. How can I do to: after sumniting the form, go to another page that tells "your record is submited"
0
9571
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10009
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.