Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to put form and display its result(data from database) on the same window?

0 views
Skip to first unread message

l...@sos.state.tx.us

unread,
Dec 7, 2005, 4:14:12 PM12/7/05
to
Hi Guys,

I have designed a web application. In its one window I put a form. User
can click submit button of this form to run a pathon script to get data
from database. Then User get a new window which display the result. Now
I want to put the form and display data on the same window. How I can
do this?

If I use frameset, I need to put form in a html file and put data in a
table in scond html file. How I can do this?


Any help is appreciated.

LLI

Xavier Morel

unread,
Dec 7, 2005, 5:40:33 PM12/7/05
to

Submit to the file holding the form, and display the data only when
informations came from the form, no need to use framesets here.

Peter Hansen

unread,
Dec 7, 2005, 6:57:30 PM12/7/05
to pytho...@python.org
l...@sos.state.tx.us wrote:
> I have designed a web application. In its one window I put a form. User
> can click submit button of this form to run a pathon script to get data
> from database. Then User get a new window which display the result. Now
> I want to put the form and display data on the same window. How I can
> do this?

The most modern approach to this, and one which appears to be evolving
into a defacto standard, is AJAX (see http://en.wikipedia.org/wiki/AJAX
and others).

It's a non-trivial solution to your problem, however, at least in terms
of the learning curve involved.

-Peter

l...@sos.state.tx.us

unread,
Dec 8, 2005, 12:21:42 PM12/8/05
to
Hi Peter,

Could you give me detailed information about your idea.

Thanks,


Laya

Peter Hansen

unread,
Dec 8, 2005, 3:01:28 PM12/8/05
to pytho...@python.org
l...@sos.state.tx.us wrote:
> Could you give me detailed information about your idea.

I believe I just did.

Really, as I said, this is "non-trivial". I can't give you a three
minute tutorial that will help you at all, especially if you haven't
read the information I pointed you to. (The page I pointed you to
actually links to the following one, in case you didn't notice:
http://en.wikipedia.org/wiki/Ajax_%28programming%29 )

-Peter

l...@sos.state.tx.us

unread,
Dec 9, 2005, 9:02:11 AM12/9/05
to
Thank you Peter. I will read it.

LLI

Tim Roberts

unread,
Dec 10, 2005, 3:11:25 AM12/10/05
to
Peter Hansen <pe...@engcorp.com> wrote:

It's also a serious case of overkill for the rather simple problem he
presented. All he needs is one function to create the form, and one
function to create the results, and do:

def PresentTable():
PrintTheForm()
if i_have_received_data:
PrintTheResultTable()
--
- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.

Peter Hansen

unread,
Dec 10, 2005, 8:35:17 AM12/10/05
to pytho...@python.org
Tim Roberts wrote:
> Peter Hansen <pe...@engcorp.com> wrote:
>>l...@sos.state.tx.us wrote:
>>>... Now

>>>I want to put the form and display data on the same window.
>>
>>The most modern approach to this...is AJAX (see http://en.wikipedia.org/wiki/AJAX
>>and others).
>>It's a non-trivial solution to your problem, however, at least in terms
>>of the learning curve involved.
>
> It's also a serious case of overkill for the rather simple problem he
> presented. All he needs is one function to create the form, and one
> function to create the results, and do:
>
> def PresentTable():
> PrintTheForm()
> if i_have_received_data:
> PrintTheResultTable()

Well, it's a matter of interpretation, isn't it? Given his vague
requirements above, it's quite valid to assume that he wants to avoid
the effects of the browser loading a new page, even if that page looks
like the previous one a lot. You may be quite right in your *guess*
that he doesn't need that, but there isn't enough information present in
his request for either of us to know.

(But you're quite correct *if he doesn't care about refreshing the
window when the form is submitted* that Ajax is overkill. I should
probably have asked for more detail in the question before suggesting Ajax.)

-Peter

Tim Roberts

unread,
Dec 12, 2005, 1:08:20 AM12/12/05
to
Peter Hansen <pe...@engcorp.com> wrote:
>
>Well, it's a matter of interpretation, isn't it? Given his vague
>requirements above, it's quite valid to assume that he wants to avoid
>the effects of the browser loading a new page, even if that page looks
>like the previous one a lot. You may be quite right in your *guess*
>that he doesn't need that, but there isn't enough information present in
>his request for either of us to know.

You are correct. Once you pointed it out, I now see what you were
suggesting.

0 new messages