Re: Open form in new window
| From: | Tedd Sperling | Date: | Wed, 06 Mar 2013 00:14:40 +0000 |
| Subject: | Re: Open form in new window | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-320411@lists.php.net to get a copy of this message | ||
On Mar 4, 2013, at 3:17 PM, Paul M Foster <paulf@quillandmouse.com> wrote:
> On Mon, Mar 04, 2013 at 05:39:00PM +0000, Tim Streater wrote:
>
>> On 04 Mar 2013 at 17:10, John Taylor-Johnston
>> <John.Taylor-Johnston@cegepsherbrooke.qc.ca> wrote:
>>
>>> <button type="button"
>>> onclick="OpenWindow()">Submit</button> will not
>>> submit the form contents.
>>
>> Nothing to stop your OpenWindow() function doing a submit as in:
>>
>> <button type="button"
>> onclick="OpenWindow(this.form)">Submit</button>
>>
>>
>> function OpenWindow (formPtr)
>> {
>>
>> // Some actions
>>
>> formPtr.submit ();
>>
>> }
>>
>>
>
>> Personally I never submit forms. I use ajax to communicate with PHP
>> scripts and do something with the data that is returned by the script.
>> You can see a simple example at http://www.clothears.org.uk
>
> --
>> Cheers -- Tim
>>
>
> I'm trying to figure out where the net gain in that is. The PHP file
> being called via AJAX is doing its processing on the server either way.
> So it appears the only difference is an asynchronous Javascript/AJAX
> call or a synchronous PHP call (on a standard PHP form submission). What
> am I missing?
>
> Paul
>
Yes, I agree with Paul -- how about an example?
That way we can see what you are trying to do.
You see, I use ajax all the time to send all sorts of things to the server without refresh, but I am
at a lost to figure out what you are doing.
Cheers,
tedd