Hi, all
When I do as the following, it becomes a GET action to the the server. How
do I make it as a POST action? That means I don't want the string after "?"
show on URL bar and, to the server, it can follow POST function to get the
data passed in. Thank you very much!
window.open("../../Server.php?"+xs Value, "", zNONHTML_STYLE) ;
Jack
Jul 23 '05
18 1717
"Michael Winter" <M.******@bluey onder.co.invali d> wrote in message news:<opshjy49n qx13kvk@atlanti s>... On Tue, 16 Nov 2004 20:11:56 +1000, q2005 <q2***@tpg.com. au> wrote:
I tried this script and found "i.type='hidden ';" won't work. I assume you mean with IE?
According to Microsoft, the type attribute "is read[-many]/write-once, but only when an input element is created with the createElement method and before it is added to the document."
To be safe, the appendChild (or similar, like insertBefore) should be the very last operation with a dynamically-created element. Set all of the properties, and only then should said element be added.
I changed to "i.type='text'; " , it works.
Actually, I doubt that. The assignment will still probably fail, but because text is the default type, it appears as though it succeeded.
[snip]
Mike
Please don't top-post.
"Ivo" wrote:
If you want to POST something, there is no around using a form.
Might want to read this: http://developer.apple.com/internet/...mlhttpreq.html
Also, the best way to handle the opening of the form action in a new
window is by 1) setting HTML form target to a specific name string and
2) calling a function onsubmit which opens a configured window,
setting its name (2nd argument to open()) to the target name. Might as
well get the window you want.
Thanks, RobB.
Can you give me an example code about "the best way to handle the opening of
the form action in a new window". Thank you very much!
Jack
"RobB" <fe******@hotma il.com> wrote in message
news:ab******** *************** ***@posting.goo gle.com... "Michael Winter" <M.******@bluey onder.co.invali d> wrote in message
news:<opshjy49n qx13kvk@atlanti s>... On Tue, 16 Nov 2004 20:11:56 +1000, q2005 <q2***@tpg.com. au> wrote:
I tried this script and found "i.type='hidden ';" won't work.
I assume you mean with IE?
According to Microsoft, the type attribute "is read[-many]/write-once,
but only when an input element is created with the createElement method and before it is added to the document."
To be safe, the appendChild (or similar, like insertBefore) should be
the very last operation with a dynamically-created element. Set all of the properties, and only then should said element be added.
I changed to "i.type='text'; " , it works.
Actually, I doubt that. The assignment will still probably fail, but because text is the default type, it appears as though it succeeded.
[snip]
Mike
Please don't top-post.
"Ivo" wrote:
If you want to POST something, there is no around using a form.
Might want to read this: http://developer.apple.com/internet/...mlhttpreq.html
Also, the best way to handle the opening of the form action in a new window is by 1) setting HTML form target to a specific name string and 2) calling a function onsubmit which opens a configured window, setting its name (2nd argument to open()) to the target name. Might as well get the window you want.
On Thu, 18 Nov 2004 00:48:30 +1000, q2005 <q2***@tpg.com. au> wrote: Can you give me an example code about "the best way to handle the opening of the form action in a new window". Thank you very much!
It's in the FAQ. The usual link is <URL:http://jibbering.com/faq/>,
however I can't access it at the moment. In the meantime, you can use an
out-of-date copy, courtesy of the Wayback Machine
(<URL:http://www.archive.org/web/web.php>):
<URL:http://web.archive.org/web/20040202174454/http://www.jibbering.c om/faq/>
[snip]
Mike
Don't top-post!
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
"Michael Winter" <M.******@bluey onder.co.invali d> wrote in message news:<opshl6oen qx13kvk@atlanti s>... On Thu, 18 Nov 2004 00:48:30 +1000, q2005 <q2***@tpg.com. au> wrote:
Can you give me an example code about "the best way to handle the opening of the form action in a new window". Thank you very much!
It's in the FAQ. The usual link is <URL:http://jibbering.com/faq/>, however I can't access it at the moment. In the meantime, you can use an out-of-date copy, courtesy of the Wayback Machine (<URL:http://www.archive.org/web/web.php>):
<URL:http://web.archive.org/web/20040202174454/http://www.jibbering.c om/faq/>
[snip]
Mike
Don't top-post!
Dug this out of the vault, hope it helps. Some bits are demo-only.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www/w3/org/TR/xhtml1">
<head>
<title>untitled </title>
<script type="text/javascript">
//<![CDATA[
function dummy(v)
{
return '<h4>' + v + '</h4>';
}
function handle_submit(f )
{
if (document.getEl ementById('w'). checked)
{
f.target = 'formpop';
f.action = 'javascript :ope ner.dummy(opene r.document.form s[0].foo.value)';
//demo only
var w = 300;
var h = 180;
var l = (screen.availWi dth - w) * .5;
var t = (screen.availHe ight - h) * .5;
var features = 'width='+w+',he ight='+h+',left ='+l+',top='+t+ ',status,scroll bars,resizable' ;
formpop = open('about :bla nk', 'formpop', features);
formpop.focus() ;
return true;
}
else
{
f.target = '_self';
f.action = 'javascript :dum my(document.for ms[0].foo.value)'; //ditto
}
}
// ]]>
</script>
</head>
<body>
<form action="javascr ipt:dummy(docum ent.forms[0].foo.value)"
onsubmit="retur n handle_submit(t his)">
<input id="w" type="checkbox" /> open in new window?<br /><br />
<input type="text" name="foo" value="...enter something here" />
<input type="submit" value="done" />
</form>
</body>
</html>
Thanks RobB.
On this example, when open in a new window, sometimes it won't work. The IE
browser said "this page can not displayed". The most times, it works.
questions:
1. Why on open new window needs to return true while on _self doesn't need?
2. Since on handle_submit() , it will change the action, is the "action=" in
the form a dummy one? Or it should have?
3. How can the action can be executed either on the new page or the original
page? Does it depend on target?
Jack <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d"> <html xmlns="http://www/w3/org/TR/xhtml1"> <head> <title>untitled </title> <script type="text/javascript"> //<![CDATA[
function dummy(v) { return '<h4>' + v + '</h4>'; }
function handle_submit(f ) { if (document.getEl ementById('w'). checked) { f.target = 'formpop'; f.action = 'javascript:ope ner.dummy(opene r.document.form s[0].foo.value)'; //demo only var w = 300; var h = 180; var l = (screen.availWi dth - w) * .5; var t = (screen.availHe ight - h) * .5; var features =
'width='+w+',he ight='+h+',left ='+l+',top='+t+ ',status,scroll bars,resizable' ; formpop = open('about:bla nk', 'formpop', features); formpop.focus() ; return true; } else { f.target = '_self'; f.action = 'javascript:dum my(document.for ms[0].foo.value)'; //ditto } }
// ]]> </script> </head> <body> <form action="javascr ipt:dummy(docum ent.forms[0].foo.value)" onsubmit="retur n handle_submit(t his)"> <input id="w" type="checkbox" /> open in new window?<br /><br /> <input type="text" name="foo" value="...enter something here" /> <input type="submit" value="done" /> </form> </body> </html>
On Thu, 18 Nov 2004 16:49:14 +1000, q2005 <q2***@tpg.com. au> wrote:
[snip] 1. Why on open new window needs to return true while on _self doesn't need?
Neither needs to return true, so don't worry about it.
2. Since on handle_submit() , it will change the action, is the "action=" in the form a dummy one? Or it should have?
I should certainly hope it's only a dummy. Making a form submission
dependant upon Javascript is moronic.
3. How can the action can be executed either on the new page or the original page? Does it depend on target?
Not sure what you're asking there.
Anyway, the answer to your previous question is a simple one. As I said,
look at the FAQ (<URL:http://jibbering.com/faq/>). The answer is there.
[snip]
Mike
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
"q2005" <q2***@tpg.com. au> wrote in message news:<41******@ dnews.tpgi.com. au>... Thanks RobB. On this example, when open in a new window, sometimes it won't work. The IE browser said "this page can not displayed". The most times, it works. questions: 1. Why on open new window needs to return true while on _self doesn't need? 2. Since on handle_submit() , it will change the action, is the "action=" in the form a dummy one? Or it should have? 3. How can the action can be executed either on the new page or the original page? Does it depend on target?
Jack
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d"> <html xmlns="http://www/w3/org/TR/xhtml1"> <head> <title>untitled </title> <script type="text/javascript"> //<![CDATA[
function dummy(v) { return '<h4>' + v + '</h4>'; }
function handle_submit(f ) { if (document.getEl ementById('w'). checked) { f.target = 'formpop'; f.action = 'javascript:ope ner.dummy(opene r.document.form s[0].foo.value)'; //demo only var w = 300; var h = 180; var l = (screen.availWi dth - w) * .5; var t = (screen.availHe ight - h) * .5; var features = 'width='+w+',he ight='+h+',left ='+l+',top='+t+ ',status,scroll bars,resizable' ; formpop = open('about:bla nk', 'formpop', features); formpop.focus() ; return true; } else { f.target = '_self'; f.action = 'javascript:dum my(document.for ms[0].foo.value)'; //ditto } }
// ]]> </script> </head> <body> <form action="javascr ipt:dummy(docum ent.forms[0].foo.value)" onsubmit="retur n handle_submit(t his)"> <input id="w" type="checkbox" /> open in new window?<br /><br /> <input type="text" name="foo" value="...enter something here" /> <input type="submit" value="done" /> </form> </body> </html>
1. Why on open new window needs to return true while on _self doesn't need?
It's not specifically necessary for either, as returning anything but
false will have no effect. Should have moved that to just before the
closing bracket, but it was trivial so I missed it.
2. Since on handle_submit() , it will change the action, is the "action=" in
the form a dummy one? Or it should have?
Yes. btw DEMO ONLY means 'remove this for real-world use'. Just wanted
to avoid posting a sample form page.
3. How can the action can be executed either on the new page or the original
page? Does it depend on target?
You'll need to try that one again.
function handle_submit(f )
{
if (document.getEl ementById('w'). checked)
{
f.target = 'formpop';
var w = 300;
var h = 180;
var l = (screen.availWi dth - w) * .5;
var t = (screen.availHe ight - h) * .5;
var features = 'width='+w+',he ight='+h+',left ='+l+',top='+t+ ',status,scroll bars,resizable' ;
formpop = open('about :bla nk', 'formpop', features);
formpop.focus() ;
}
else f.target = '_self';
return true;
}
// ]]>
</script>
</head>
<body>
<form action="[whatever]"
onsubmit="retur n handle_submit(t his)">
"Ivo" <no@thank.you > wrote in message news:<41******* *************** *@news.wanadoo. nl>... s, Ivo. It's so helpful. By the way, after summit, how do I delete the form object? Thanks again!
You don't. The form is submitted, so the whole page is 'deleted' as the server responds with a brand new page. Note that the example code provided does not test for features before using them. Include if(document.cre ateElement) {...} and stuff like that before using it in the real world. Also, try to avoid relying on javascript. If you can do it with an ordinary form, and it sounds like you can, then do.
If document.create Element() is not supported, what else should we test
for? Or appendChild? I assume this is GECKO DOM? The alternative would
be IE's DOM? Or vice versa? Are there mostly 2 DOM's out there to test
for, or more?
Is it possible to submit the forms without submitting the page? If
possible that might be a nice way to do an interface for a chat
software running PHP and MySql in the background.
On 18 Nov 2004 12:56:22 -0800, lawrence <lk******@geoci ties.com> wrote:
Just briefly...
[snip] If document.create Element() is not supported, what else should we test for? Or appendChild? I assume this is GECKO DOM?
No, it's the W3C - the standardised - DOM. Microsoft just doesn't support
it too well.
The alternative would be IE's DOM?
Pretty much. However, IE does support those methods you mentioned. There
aren't any alternatives as far as I know.
[snip]
Mike
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: perseus |
last post by:
I think that everyone who told me that my question is irrelevant,
in particular Mr. David White,
is being absolutely ridiculous. Obviously, most of you up here
behave like the owners of the C++ language. A C++ interface
installation IS ABOUT THE C++ LANGUAGE! The language
does not possess the ability to handle even simple file directory
manipulation.
Those wise people that created it did not take care of it. So, BOOST
is a portable...
|
by: sbayeta |
last post by:
Hi,
I'd like to know who is responsible of memory recycling and
defragmentation in a C/C++ program, assuming all the memory
allocation/deallocation is done using malloc/free or new/delete.
Thanks
|
by: designconcepts |
last post by:
bo'jour, bo'jour,
So I have question to present to the forum about OOD. This is a Csharp
forum, but C# is the lang of choice and the question is an exercise based on
some comments by the chief designer of C#. Those of you who are junkies for
design principle might be interested in contributing to this thread.
I was recently reading some interviews with the chief engineer for C#
(formerly Mr. Delphi), and he made an interesting comment...
|
by: BM |
last post by:
Hello,
Ok, Im new to using ASP.NET and IIS so im not sure how or where to post this
question but here goes:
I am running IIS 5.1 on WinXP. I need to process http POST messages sent
from another application that I dont have control over. The messages are
sent to a web page called test.htm . The message looks similiar to the
following:
|
by: glenn |
last post by:
I am use to programming in php and the way session and post vars are past
from fields on one page through to the post page automatically where I can
get to their values easily to write to a database or continue to process on
to the next page.
I am now trying to learn ASP to see if we can replace some of our
applications that were written in php with an ASP alternative. However,
after doing many searches on google and reading a couple...
| |
by: Rider |
last post by:
Hi, simple(?) question about asp.net configuration..
I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm
first start application the follow message shown.
=========
Server Error in '/QuickStartv20' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file
|
by: MP |
last post by:
Greets,
context: vb6/ado/.mdb/jet 4.0 (no access)/sql
beginning learner, first database, planning stages
(I think the underlying question here is whether to normalize or not to
normalize this one data field - but i'm not sure)
:-)
Background info:
|
by: Jeff |
last post by:
In the function below, can size ever be 0 (zero)?
char *clc_strdup(const char * CLC_RESTRICT s)
{
size_t size;
char *p;
clc_assert_not_null(clc_strdup, s);
size = strlen(s) + 1;
|
by: stwebmail |
last post by:
If you are dealing with one PCI card, is there a way (from within a
dll) to find out which PCI slot that card is inhabiting (1 or 2 or 6,
etc.)? It doesn't matter if the solution is MFC, or straight C++/C,
just has to be on a Windows machine.
|
by: TamusJRoyce |
last post by:
I know it's bad to cross post, but I'm not sure if this is a VB or a .Net question, since I'm a C++ programmer primarily. My code I'm working on is VB .Net, and I'm not familiar with the Framework to know if it's a framework or language question.
To Moderator: Please move http://bytes.com/forum/thread850506.html here if it is, and you think it is worthy of being a good question (I wonder if this question could turn into a good tutorial, if...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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();...
|
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...
| |
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |