Applejus wrote:
Hello there,
Kind of newbie to PHP and javascript... I have this problem:
I want to pass a javascript variable to a PHP code.
I am inside a javascript function that is creating HTML elements
dynamically. After creating a select tag, I want to populate it with a
list of
William Stokes wrote:
Hello,
I need some advice on how to learn Javascript and PHP interaction. Any good
tutorials on the web would be most welcome. I particulary need to learn how
to pass JS user input/choices to PHP.
My current problem is how to ask user confirmation over his actions
William Stokes wrote:
Hello,
I need some advice on how to learn Javascript and PHP interaction. Any good
tutorials on the web would be most welcome. I particulary need to learn how
to pass JS user input/choices to PHP.
My current problem is how to ask user confirmation over his actions on a
Myron Turner skrev:
William Stokes wrote:
Hello,
I need some advice on how to learn Javascript and PHP interaction. Any
good tutorials on the web would be most welcome. I particulary need to
learn how to pass JS user input/choices to PHP.
My current problem is how to ask user confirmation
I think a better way for you to go(it may be a little bit more
difficult, but it won't have any annoying flickering from the
reloading of page) is to use AJAX.
But if you insist on going on a PHP form + Javascript validation -
submit form -PHP form + Javascript validation, that can be done as
Beauford wrote:
Hi,
I have a form with about 20 fields in it and have two drop down menus in
which the second one changes depending on the previous one. This is done
with a javascript which reloads the page.
The problem with this is that everything the user has put in so far gets
erased
At 10:03 PM -0400 5/30/06, Beauford wrote:
Hi,
I have a form with about 20 fields in it and have two drop down menus in
which the second one changes depending on the previous one. This is done
with a javascript which reloads the page.
The problem with this is that everything the user has put in
Jay Blanchard wrote:
Can they play nicely together?
For instance I have a small JavaScript sniplet that will check certain
checkboxes if a radio button is selected. Since I have a fair amount of
checkboxes I want to put them in an array all their own so I use the
XHTML syntax w/brackets;
input
-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Friday, May 19, 2006 10:34 AM
To: php-general@lists.php.net
Subject: [PHP] PHP JavaScript
input type=checkbox name=list37[] value=7 /
Suddenly JavaScript doesn't care for the object and throws an error
[snip]
http://us2.php.net/variables.external
[/snip]
BINGO! We have a winner!
It can be as simple as adding an id to each checkbox;
input type=checkbox id=list37 name=list37[] value=4 /
By doing this I did not have to change the function or the function
calls. JS recognizes the boxes by id,
John Nichel wrote:
Jay Blanchard wrote:
Can they play nicely together?
For instance I have a small JavaScript sniplet that will check certain
checkboxes if a radio button is selected. Since I have a fair amount of
checkboxes I want to put them in an array all their own so I use the
XHTML
Jay Blanchard wrote:
[snip]
http://us2.php.net/variables.external
[/snip]
BINGO! We have a winner!
It can be as simple as adding an id to each checkbox;
input type=checkbox id=list37 name=list37[] value=4 /
By doing this I did not have to change the function or the function
calls.
I think it's a case of using id for javascript, not for css...
--
http://www.web-buddha.co.uk
dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)
look out for project karma, our new venture, coming soon!
Jay Blanchard wrote:
[snip]
http://us2.php.net/variables.external
[/snip]
BINGO! We have a winner!
It can be as simple as adding an id to each checkbox;
input type=checkbox id=list37 name=list37[] value=4 /
By doing this I did not have to change the function or the function
calls. JS
Dave Goodchild wrote:
I think it's a case of using id for javascript, not for css...
Call me a purist, but quoting http://www.w3.org/TR/xhtml1/ (and you
can probably find likewise paragraphs in other xhtml specs, all
stemming from the basic XML property that id's are unique):
4.10. The elements
[snip]
So, using the same ID produces non-valid documents if you ask me.
[/snip]
This is correct, and in order to properly validate I changed it to
transitional instead of strict. This is an internal appif it were
external I would do this differently for sure
--
PHP General Mailing List
I use document.getElementById().value.
The only change that would need to be made with the input example is add
an id=list['.$x.']
Jef
-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Friday, May 19, 2006 8:47 AM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP
Simplest solution is to use id=whatever for JS.
It *is* possible to get [] into the name of a box in JS, but I never
succeeded in any useful way myself.
On Fri, May 19, 2006 9:33 am, Jay Blanchard wrote:
Can they play nicely together?
For instance I have a small JavaScript sniplet that will
For grouped checkboxes that have numerical keys, why not give them an ID
that's simply a concatenation of NAME and the VALUE, so it's unique?
Run the NAME though a preg_replace to replace non alphanum chars (\W+) with
an underscore first to make sure it's a valid ID.
i.e.
checkbox name=blah[]
[snip]
For grouped checkboxes that have numerical keys, why not give them an ID
that's simply a concatenation of NAME and the VALUE, so it's unique?
[/snip]
Because JavaScript loops through all the like ID'ed checkboxes to check
or uncheck groups. It could be done the other way, but then
Yeah, i guess it all depends what you're doing what works for you.
Another avenue to try (depending on your application) is:
Group all your checkboxes together inside of a uniquely-named DIV and then
use javascript to get all of the checkbox elements inside the DIV. That
way, you dont really
On May 19, 2006, at 8:20 AM, Jay Blanchard wrote:
[snip]
http://us2.php.net/variables.external
[/snip]
BINGO! We have a winner!
It can be as simple as adding an id to each checkbox;
input type=checkbox id=list37 name=list37[] value=4 /
By doing this I did not have to change the function or
this post was meant for the OP - I sent it to Chris W. (only) by mistake.
oops
Original Message
From: - Wed Mar 09 19:50:29 2005
Chris W. Parker wrote:
Mário Gamito mailto:[EMAIL PROTECTED]
on Tuesday, March 08, 2005 4:28 PM said:
I'm trying to integrate some JavaScript
Hi,
I'm trying to integrate some JavaScript functions in PHP, but so far, no
good :(
I want to have a js.php file that has the JavaScript functions i want to
use. This file, albeit its extension, has no PHP code or even tag.
It's just like this:
js.php
--
script language=JavaScript
On Wed, Mar 09, 2005 at 12:27:39AM +, M?rio Gamito wrote:
Hi,
I'm trying to integrate some JavaScript functions in PHP, but so far, no
good :(
I want to have a js.php file that has the JavaScript functions i want to
use. This file, albeit its extension, has no PHP code or even tag.
Mário Gamito mailto:[EMAIL PROTECTED]
on Tuesday, March 08, 2005 4:28 PM said:
I'm trying to integrate some JavaScript functions in PHP, but so far,
no good :(
[snip]
Now... i want to call this JavaScript function from the regular PHP
files. In particular, before the HTML code.
Like
I have a webform which my users are expecting to act like a Windows program,
they only need to check the box and it is automatically written to the
database.
you could try this
http://developer.apple.com/internet/webcontent/iframe.html
or this
http://jibbering.com/2002/4/httprequest.html
--
Hi everybody!
Have somebody any idea how I could do something like that?
?
settype($phpScreenWidth, string);
settype($phpScreenHeight, string);
?
script language=javascript
var phpScreenWidth, phpScreenHight;
Exactly.
but it should be only with one step.
That means, just running the file once and get the vars.
cbq
-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]
Sent: Donnerstag, 23. Oktober 2003 03:00
To: 'BQ777'; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP JavaScript
Hi
Martin Towell [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi everybody!
Have somebody any idea how I could do something like that?
?
settype($phpScreenWidth, string);
settype($phpScreenHeight, string);
?
This is a serverside process
This
Have somebody any idea how I could do something like that?
snip javascript and PHP
You're somewhat out of luck, as the chain of events in your typical HTTP
transaction looks something like this...
[time]-
client request received from browser
-WIN] Re: [PHP] PHP JavaScript
Have somebody any idea how I could do something like that?
snip javascript and PHP
You're somewhat out of luck, as the chain of events in your typical HTTP
transaction looks something like this...
[time]-
client
John W. Holmes [EMAIL PROTECTED]
To: Mauricio [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 10:05 AM
Subject: Re: [PHP] PHP/JavaScript/HTML
From: Mauricio [EMAIL PROTECTED]
I wrote a JavaScript to set the values of a Select html object by client
side. The values are copied
From: Mauricio [EMAIL PROTECTED]
I wrote a JavaScript to set the values of a Select html object by client
side. The values are copied from another Select that I create getting the
values from the database. After the user set the values he/she wants to
add
it in another form, for example, then
From: Mauricio [EMAIL PROTECTED]
On the Address Bar I can see: index.php?slcAdd=1slcAdd=2slcAdd=3
But when I get the value using $HTTP_GET_VARS['slcAdd']; it returns just
the
last value. What can I do to get them all?
Name your select box as slcAdd[] and you'll have all of the values in an
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED] Php. Net
Subject: Re: [PHP] PHP, JavaScript and populating DropDowns
assuming you have a table with colors, and each color has car associated
with it (yes, there might be dup color entries).
This should work (check spellings and case, etc..etc...)
$query
assuming you have a table with colors, and each color has car associated
with it (yes, there might be dup color entries).
This should work (check spellings and case, etc..etc...)
$query=SELECT * from colors;
$results = mysql_query($query) or die (DB ERROR: . mysql_error());
$num =
Since you had problems with quotes yesterday too, I would suggest reading
the manual page on strings so you do not continue to have the same problems
day after day.
http://www.php.net/manual/en/language.types.string.php
-Original Message-
From: Micah Montoy [mailto:[EMAIL PROTECTED]
U need to quote it with double quotes and escape them with like so:
\
that should work for you. If not then you will need to start separating
the string out and joining it with the . .
--
BigDog
On Wed, 2003-07-09 at 15:51, Micah Montoy wrote:
Anyone have an idea of how to get this to work?
-Original Message-
From: Stephen [mailto:[EMAIL PROTECTED]
Sent: 06 June 2003 15:48
Thanks for your reply. I had actually made a mistake in the
code. It looks
like this now:
How could I still use the id thing on this?
Well, the addition of the stripslashes() call
-Original Message-
From: Stephen [mailto:[EMAIL PROTECTED]
Sent: 05 June 2003 19:15
Here's my javascript link code for each day of the month in
the calendar script:
print a href=\#\
onClick=\window.opener.document..$HTTP_GET_VARS['name']..da
te.value='$y-$m-$d';\$d/a;
:22 AM
Subject: RE: [PHP] PHP/Javascript Help
-Original Message-
From: Stephen [mailto:[EMAIL PROTECTED]
Sent: 05 June 2003 19:15
Here's my javascript link code for each day of the month in
the calendar script:
print a href=\#\
onClick=\window.opener.document
document.forms[0].elements['select1[]']
Assuming the form is your first form on the page, reference the element
in JavaScript as above.
Greg wrote:
I have a problem with 2 select multiple boxes in my PHP pages. In order for
PHP to pass multiple values to a page that it is posted to, the name
thanks Jason, between this the other suggestions I was emailed I believe I
can make this all work like I need to.
Jeff
Jason Wong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Wednesday 12 February 2003 08:47, Jeff Bluemel wrote:
OK... I have a dynamic
Thank you so much, that worked perfectly...I know it's off topic, but do you
know how to automatically select all elements of a select multiple box and
then submit the form using a submit button? Thanks!
-Greg
John Nichel [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL
On Wednesday 12 February 2003 08:47, Jeff Bluemel wrote:
OK... I have a dynamic menu system, and I have to maintain a dynamic menu.
however, the amount of content I need in my menu is going to be rapidly
outgrown. I believe my only solution is to deploy a javascript drop down
menu (users
-Original Message-
From: David D [mailto:[EMAIL PROTECTED]]
Sent: 13 July 2002 16:38
I can manage this script to work.
Js warn about listid[], he doesnt like [] in a var name !
Php needs them to collect an array from form checkboxes.
form name=test action=check.php
input
On Saturday 13 July 2002 23:37, David D wrote:
Hi all,
I can manage this script to work.
Js warn about listid[], he doesnt like [] in a var name !
There's nothing you can do about that.
Php needs them to collect an array from form checkboxes.
You'll just have to rename your checkboxes to
I hack js no need to change in php :
SCRIPT LANGUAGE=JavaScript
!-- Begin
var checkflag = false;
// on va se ballader parmis les elements de formualire et toucher
// au case a cocher
function check(formulaire) {
if (checkflag == false) {
for (i = 0; i formulaire.length; i++) {
if
check out the reply he sent to my last message. it had the code as an
attachment.
Jim Lucas
- Original Message -
From: David Freeman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 24, 2002 2:25 PM
Subject: RE: [PHP] php JavaScript
I've tried to include a simple
Can you please explain what you're doing more?
PHP and Javascript are completely different. PHP happens first, on the web
server, to create code to send to the browser. The browser then interprets
this code, executes any javascript, etc, and displays the page. You can't
have both at the same
nope, theres nothing in apache that needs to be setup for js to be used.
does your js file have any php in it?
when you say that you couldn't get it to work, do you mean that the include
doesn't work or that the js doesn't work on the page that you are including
it to?
Jim Lucas
- Original
I've tried to include a simple javascript in a .php file,
but couldn't get it to work.
Actually not even the php code worked at all...
Is there any specific configuration flag that needs to be
set up in the Apache server so that the javascripts work
correctly?
Not
On Friday 31 May 2002 13:18, Gerard Samuel wrote:
Just a general question. Is it possible to embed php in pure
javascript/dhtml code??
I tried but it didn't work, not sure if it was me or its not possible.
Thanks...
As long as you enclose the PHP code in script delimiters (?php ... ?) and
That seems like over complicating the problem to me.
Why not just include the original query string that was passed from
fooa.php by:
header(Location:foa.php?$QUERY_STRING)
-Jackson
On Mon, 2002-04-01 at 12:28, Simos Varelakis wrote:
Here is a problem :-)
A php post form fooa.php
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP-JavaScript
In a word... No.
Well...
No.
Mårten Andersson wrote:
Is it posible to get values from javascript to PHP? Without having
to
post the variables..
Thanks
: [PHP] PHP-JavaScript
In a word... No.
Well...
No.
Mårten Andersson wrote:
Is it posible to get values from javascript to PHP? Without having
to
post the variables..
Thanks //Mårten
Ward
Cc: Mårten Andersson; [EMAIL PROTECTED]
Subject: Re: [PHP] PHP-JavaScript
Unfortunately, that won't work if the value of the JS variable needs to
change dynamically based on user interaction; document.write() only
works as the page is loaded (well... MSIE might be different
Message-
From: Richard Crawford [SMTP:[EMAIL PROTECTED]]
Sent: 21 January 2002 15:59
To: Tim Ward
Cc: Mårten Andersson; [EMAIL PROTECTED]
Subject: Re: [PHP] PHP-JavaScript
Unfortunately, that won't work if the value of the JS variable needs to
change dynamically based on user interaction
],
Richard Crawford [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] PHP-JavaScript
Or get the JS to rewrite a query string in a link, but personally I wouldn't
rely on JS that far.
Tim
www.chessish.com http://www.chessish.com
--
From: Richard Crawford [SMTP
In a word... No.
Well...
No.
Mårten Andersson wrote:
Is it posible to get values from javascript to PHP? Without having to
post the variables..
Thanks //Mårten
_
Chatta med vänner online, prova MSN Messenger:
Hi,
A little trick I did to get the text from a textbox in a form
( for user comments ) without the user having to submit it was to
use javascript to append the textbox contents to a url ( GET METHOD )
when the user clicked on a link, which pointed to a redirect script
which extracted the
Leave the input name as email. If you really want to call it email[],
you should be able to reference this in JavaScript as the object
document.myform[email[]]
If you leave it as email, you can then convert the email variable into an
array using explode() or split() as so:
?php
// on the
, 2001 2:47 AM
Subject: Re: [PHP] php javascript
Try document.myform.elements['email[]'] like below
script language=javascript
function func( field ) {
for ( i = 0; i field.length; i++ )
field[i].checked = true ;
}
/script
form name=myform
input type=checkbox name=email
[]
- Original Message -
From: Matthew Armsby [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 03, 2001 2:54 AM
Subject: Re: [PHP] php javascript
Leave the input name as email. If you really want to call it email[],
you should be able to reference this in JavaScript as the object
document.myform[email[]] seems to give me a syntax error.
Check if your already using you'll need to use single quotes as so:
input type=button name=CheckAll value=Check All
onClick=checkAll(document.myform['email[]'])
(tested on IE 5.5 and NS 4.08, works)
If you leave it as email, you can
This is usually handled by the browser automatically. (Nobody likes to see
out of date content when browsing the web). Users can set their browser
settings to check for new things once per session, every time, or never (or
some variation of these). Most users use once per session. Otherwise,
67 matches
Mail list logo