By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,480 Members | 1,224 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,480 IT Pros & Developers. It's quick & easy.

Re: Using innerhtml

P: n/a
SAM
Mtek a écrit :
Hi,

This is the content of my DIV now:
no, that is the code given to the server
we need the code received by the browser
>
echo " <div class='innerb'>";
(snip)
echo "</div>";

We want to refresh the DIV (innerb) without refreshing the page, and
if we do not have to use ajax either.
you'll certainly need Ajax
or to send the form and get-it back
So, the user selected the date ($pdate) from the combobox,
what is a "combobox" ?
where it is ?
I know this can be
done, but it is just a matter of finding the code or something
similar......
<http://developer.mozilla.org/en/docs/AJAX>

--
sm
Jun 27 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On May 5, 5:46*pm, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
Mtek a écrit :
Hi,
This is the content of my DIV now:

no, that is the code given to the server
we need the code received by the browser


* * * * * * * echo " * * *<div class='innerb'>";
(snip)
* * * * * * * echo "</div>";
We want to refresh the DIV (innerb) without refreshing the page, and
if we do not have to use ajax either.

you'll certainly need Ajax
or to send the form and get-it back
So, the user selected the date ($pdate) from the combobox,

what is a "combobox" ?
where it is ?
I know this can be
done, but it is just a matter of finding the code or something
similar......

<http://developer.mozilla.org/en/docs/AJAX>

--
sm

The combo box is in another part of the screen. The page is rather
large. It is not a form. It just has one combo box, and once the
user selects an item, I want the script to get the results from MySQL
and display them, without having to redraw the entire page.......

I know this can be done, I just do not know how.....

John.
Jun 27 '08 #2

P: n/a
On May 6, 12:37*am, Mtek <m...@mtekusa.comwrote:
On May 5, 5:46*pm, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:


Mtek a écrit :
Hi,
This is the content of my DIV now:
no, that is the code given to the server
we need the code received by the browser
* * * * * * * echo " * * *<div class='innerb'>";
(snip)
* * * * * * * echo "</div>";
We want to refresh the DIV (innerb) without refreshing the page, and
if we do not have to use ajax either.
you'll certainly need Ajax
or to send the form and get-it back
So, the user selected the date ($pdate) from the combobox,
what is a "combobox" ?
where it is ?
I know this can be
done, but it is just a matter of finding the code or something
similar......
<http://developer.mozilla.org/en/docs/AJAX>
--
sm

The combo box is in another part of the screen. *The page is rather
large. *It is not a form. *It just has one combo box, and once the
user selects an item, I want the script to get the results from MySQL
and display them, without having to redraw the entire page.......

I know this can be done, I just do not know how.....

John.- Hide quoted text -

- Show quoted text -
As mentioned in a previous post you have only two options if you do
not want a total page refresh...

1). To bring over not only the options, but also the results of each
option, and generate the entire page at once storing the results in a
series of hidden div elements. Then when they select an option make
that matching div visible. or...

2). Query the server when an option is selected. If this is your
choice then you must either use XMLHttpRequest and process the results
in your callback handler or put your combo box in a form and set the
target of the form to a (i)Frame.

Unless you are dealing with a script that is being called from a
different domain I would use XMLHttpRequest as any modern browser that
can do one, can also do the other as they both require Javascript and
all modern browsers support XMLHttpRequest in one form or another.

If you choose method 2 (the (i)Frame method) your return code can
include javascript that calls javascript methods in the parent frame.

You're not going to be able to include PHP code inside your HTML and
have it magically generate results for you on the client side.

HTH.
Jun 27 '08 #3

P: n/a
On May 6, 6:56 am, Tom Cole <tco...@gmail.comwrote:
On May 6, 12:37 am, Mtek <m...@mtekusa.comwrote:
On May 5, 5:46 pm, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
Mtek a écrit :
Hi,
This is the content of my DIV now:
no, that is the code given to the server
we need the code received by the browser
echo " <div class='innerb'>";
(snip)
echo "</div>";
We want to refresh the DIV (innerb) without refreshing the page, and
if we do not have to use ajax either.
you'll certainly need Ajax
or to send the form and get-it back
So, the user selected the date ($pdate) from the combobox,
what is a "combobox" ?
where it is ?
I know this can be
done, but it is just a matter of finding the code or something
similar......
<http://developer.mozilla.org/en/docs/AJAX>
--
sm
The combo box is in another part of the screen. The page is rather
large. It is not a form. It just has one combo box, and once the
user selects an item, I want the script to get the results from MySQL
and display them, without having to redraw the entire page.......
I know this can be done, I just do not know how.....
John.- Hide quoted text -
- Show quoted text -

As mentioned in a previous post you have only two options if you do
not want a total page refresh...

1). To bring over not only the options, but also the results of each
option, and generate the entire page at once storing the results in a
series of hidden div elements. Then when they select an option make
that matching div visible. or...

2). Query the server when an option is selected. If this is your
choice then you must either use XMLHttpRequest and process the results
in your callback handler or put your combo box in a form and set the
target of the form to a (i)Frame.

Unless you are dealing with a script that is being called from a
different domain I would use XMLHttpRequest as any modern browser that
can do one, can also do the other as they both require Javascript and
all modern browsers support XMLHttpRequest in one form or another.

If you choose method 2 (the (i)Frame method) your return code can
include javascript that calls javascript methods in the parent frame.

You're not going to be able to include PHP code inside your HTML and
have it magically generate results for you on the client side.

HTH.
No, cannot include PHP on the client side, but how about calling a PHP
routine on the server and returning the results? I've seen simple
examples of this, though mine is a bit more complex......

John.
Jun 27 '08 #4

P: n/a
On May 6, 8:42*am, Mtek <m...@mtekusa.comwrote:
On May 6, 6:56 am, Tom Cole <tco...@gmail.comwrote:


On May 6, 12:37 am, Mtek <m...@mtekusa.comwrote:
On May 5, 5:46 pm, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
Mtek a écrit :
Hi,
This is the content of my DIV now:
no, that is the code given to the server
we need the code received by the browser
* * * * * * * echo " * * *<div class='innerb'>";
(snip)
* * * * * * * echo "</div>";
We want to refresh the DIV (innerb) without refreshing the page, and
if we do not have to use ajax either.
you'll certainly need Ajax
or to send the form and get-it back
So, the user selected the date ($pdate) from the combobox,
what is a "combobox" ?
where it is ?
I know this can be
done, but it is just a matter of finding the code or something
similar......
<http://developer.mozilla.org/en/docs/AJAX>
--
sm
The combo box is in another part of the screen. *The page is rather
large. *It is not a form. *It just has one combo box, and once the
user selects an item, I want the script to get the results from MySQL
and display them, without having to redraw the entire page.......
I know this can be done, I just do not know how.....
John.- Hide quoted text -
- Show quoted text -
As mentioned in a previous post you have only two options if you do
not want a total page refresh...
1). To bring over not only the options, but also the results of each
option, and generate the entire page at once storing the results in a
series of hidden div elements. Then when they select an option make
that matching div visible. or...
2). Query the server when an option is selected. If this is your
choice then you must either use XMLHttpRequest and process the results
in your callback handler or put your combo box in a form and set the
target of the form to a (i)Frame.
Unless you are dealing with a script that is being called from a
different domain I would use XMLHttpRequest as any modern browser that
can do one, can also do the other as they both require Javascript and
all modern browsers support XMLHttpRequest in one form or another.
If you choose method 2 (the (i)Frame method) your return code can
include javascript that calls javascript methods in the parent frame.
You're not going to be able to include PHP code inside your HTML and
have it magically generate results for you on the client side.
HTH.

No, cannot include PHP on the client side, but how about calling a PHP
routine on the server and returning the results? *I've seen simple
examples of this, though mine is a bit more complex......

John.- Hide quoted text -

- Show quoted text -
That's where XMLHttpRequest comes in, that or the form submission
option. AFAIK there's no other way for a browser to initiate a server
request. So where are the simple examples you've seen, maybe that
would help enlighten me to your specific task.

Is it that you don't know/want to learn XMLHttpRequest or do you
really think there's an easier way? If you're uncomfortable with the
idea, you're pretty much stuck with encapsulating your select within a
form and plain ol' submitting the form, having PHP generate your
updated response page. But without a complete page refresh, you're
going to have to intiate an XMLHttpRequest, or generate a form
submission to an (i)Frame.
Jun 27 '08 #5

P: n/a
Mtek wrote:
On May 6, 6:56 am, Tom Cole <tco...@gmail.comwrote:
>On May 6, 12:37 am, Mtek <m...@mtekusa.comwrote:
>>On May 5, 5:46 pm, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
You're not going to be able to include PHP code inside your HTML and
have it magically generate results for you on the client side.

HTH.

No, cannot include PHP on the client side, but how about calling a PHP
routine on the server and returning the results? I've seen simple
examples of this, though mine is a bit more complex......

John.
Yes, they call that AJAX.
Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.