473,405 Members | 2,445 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,405 software developers and data experts.

form-tak php and javascript

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
Aug 12 '07 #1
6 1400
Michael Schrading wrote:
But how to start a php-script within a Javascript-function which will do this?
Not really a PHP problem...
Youre javascript keyword to search for is: Ajax (XmlHttpRequest)

So long, Ulf

--
_,
_(_p Ulf [Kado] Kadner
\<_)
^^
Aug 12 '07 #2
Thanks Ulf.

One solution to start for me was like window.location.href="php-script"; without Ajax but I'm not sure to loos the session on doing this!?

Thank you for the hint

Michael

"Ulf Kadner" <dr******@gmx.netschrieb im Newsbeitrag news:f9*************@news.t-online.com...
Michael Schrading wrote:
>But how to start a php-script within a Javascript-function which will do this?
Not really a PHP problem...
Youre javascript keyword to search for is: Ajax (XmlHttpRequest)

So long, Ulf

--
_,
_(_p Ulf [Kado] Kadner
\<_)
^^
Aug 12 '07 #3
Michael Schrading wrote:
One solution to start for me was like window.location.href="php-script";
Better to doit with a hidden Iframe (0x0 pixel size) if you will dot use
ajax.

And if you will send the session-ID simple prepend it to the used url.

PS.:
I can see you are a german. Why you dont ask youre PHP questions in
de.comp.lang.php.misc? There is no problem if you doit here but maybe
its easier for you to ask in german?
>--
_,
_(_p Ulf [Kado] Kadner
\<_)
^^
A bad newsreader you use. Signatures will never be replied.

--
_,
_(_p Ulf [Kado] Kadner
\<_) Mitglied der Freizeitvögel? ;-)
^^
Aug 12 '07 #4
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
Aug 12 '07 #5
PS.:
I can see you are a german. Why you dont ask youre PHP questions in
de.comp.lang.php.misc? There is no problem if you doit here but maybe
its easier for you to ask in german?
Cause it isn't in my newsgroup list. But thanks alot for Deine Hilfe.

Michael
Aug 12 '07 #6

Julien Plée;86402 Wrote:
>
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
Merci Julien,

If you want the link in German,
http://developer.mozilla.org/de/docs/AJAX
Or in English, http://developer.mozilla.org/en/docs/AJAX

FFMG
--

'webmaster forum' (http://www.httppoint.com) | 'Free Blogs'
(http://www.journalhome.com/) | 'webmaster Directory'
(http://www.webhostshunter.com/)
'Recreation Vehicle insurance'
(http://www.insurance-owl.com/other/car_rec.php) | 'Free URL
redirection service' (http://urlkick.com/)
------------------------------------------------------------------------
FFMG's Profile: http://www.httppoint.com/member.php?userid=580
View this thread: http://www.httppoint.com/showthread.php?t=19300

Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).

Aug 13 '07 #7

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

Similar topics

3
by: John | last post by:
Dear all, It been more than 3 days I am trying to debug this program, I interpret it using activePerl and it is giving (perl -wc code_process.pl) no error syntax but when I put it online, change...
5
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
19
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the...
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
5
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
6
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
5
by: ortaias | last post by:
I have a form which calls up a second form for purposes of data entry. When closing the data entry form and returning to the main form, things don't work as expected. When I return to the main...
3
by: Bill | last post by:
I'm using the POST method to submit a simple form html page with yes/no and checkbox fields to an asp response page which stores the values in a new dim string, then uses it to build a new table...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
tracyyun
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...
0
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...

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.