For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > August 2007 > form-tak php and javascript









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author form-tak php and javascript
Michael Schrading

2007-08-12, 7:58 am

Hello world :-)

My problem ist to have a line like this

<form ... action=3D"url/script.php" .... onsubmit=3D"return running();">

the function running() is a Javascript- function which should call a =
php-script, just to set a value in a variable and to know that the form =
has been submitted, and than close this php script.=20

But how to start a php-script within a Javascript-function which will do =
this??

I know it's sunday, but... :-)=20

please for a help or hint wouild be fine.

Michael
Julien Plée

2007-08-12, 6:59 pm

Le Sun, 12 Aug 2007 12:13:44 +0200, Michael Schrading a écritÂ_:

> Hello world :-)
>
> My problem ist to have a line like this
>
> <form ... action="url/script.php" .... onsubmit="return running();">
>
> the function running() is a Javascript- function which should call a
> php-script, just to set a value in a variable and to know that the form
> has been submitted, and than close this php script.
>
> But how to start a php-script within a Javascript-function which will do
> this??
>
> I know it's sunday, but... :-)
>
> please for a help or hint wouild be fine.
>
> Michael


Hello,

With this sunny sunday, I guess I won't stay long at home :)
However I'll take a few seconds for answering you.

You can give a try to Ajax requests. I allows lightweight server script
call through HTTPXmlRequest and should be OK with most browsers. I used
to create a SCRIPT element for almost the same purpose but it could'nt
work on Safari as Safari refused to load an external source during
creation.

http://developer.mozilla.org/fr/docs/AJAX


Have a nice sunday computing!


Julien
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com