![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Aug 2005
Posts: 66
Rep Power: 0
![]() |
Python and iframes - can it work?
Yo all,
O.K, I've got a web app built that does stuff depending on the user and then prints it back out on screen. The code for the entire app, (printing the page as well as doing the calculation) is all in one python file. (e.g. foo.py) Right now, I have a navigation page with a bunch of submit buttons that, depending on the value that is sent, will print out the corrsponding page. I'm trying to change my navigation page to use tab browsing. My orgional idea for it was to have the button send the post to the given iframe by setting the "target" attribute. However, instead of doing the desired post, it just reprints the first page to foo.py. It seems that the iframe dosen't have knowledge the the outer-page sent a post with specific variables and just gives foo.py from square one before the login. Anyone have any ideas how I can make this work. I hope I've given enough detail, if not I'll try to clearify whatever is fuzzy. Thanks a bunch! (This forum is great! ) |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Afraid you'll have to re-phrase a bit. The first half sounds like a non-Python related HTML thing, while the second half looks like you want to send some data across different browsed pages, which would require some kind of session keeping.
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: Aug 2005
Posts: 66
Rep Power: 0
![]() |
Alrighty then. ^_^
Lets see...I've got a set-up like the following: The Page Layout Forgive my crude drawing, but I think that will help. :p The page (foo.py) starts off with an authencation login page and then goes to a page simmilar to the above. Tabs A, B, and C are <input type="submit> buttons with the target attribute set to the iframe. Thus, when I post, I want the resulting data from that post to appear in the iframe. However, when I click the tab, the authentacation page for foo.py is loaded into the iframe instead of the calculation from the post. The layout that I had first with no iframes was the following: Before Iframes And this worked just fine. It printed out the result page with a button that would re-print the navigation page. I'm trying to have those result pages print into the iframe in my new design, but as I said before, it just reprints the login page. As near as I can figure, because the form tag is: <form action="www.place/foo.py" method="post" name="bar"> It just puts that url and thus the login page straight into the iframe instead of carrying over the information that I want it to as it did in my old design. When a post is sent, the key that the button sent is checked and a procedure is set to that key, then that procedure is carried out and the resulting page is printed. *whew* Well, I hope that makes things clearer. Thanks all! ^_^ Last edited by MegaArcon; Oct 13th, 2005 at 7:40 AM. |
|
|
|
|
|
#4 |
|
Programmer
Join Date: Aug 2005
Posts: 66
Rep Power: 0
![]() |
eureka! Blah! It was just a dummy mistake on my part. :mad:
There were two levels to my page, and thus two forms. My inner form (the one dealing with the iframe) didn't know about the authentication stuff, and thus the authentication would fail every time and print out the login page. All I needed to do was make both form's aware of the user's values and *boom* it works as expected. Warg. Don't mean to waste people's time here. :p This is the second time I've posted on these boards and then answered my own question. Mabye I should play a little longer when I have a problem and come to the boards when I've completely run out of options....then again, sometimes the best way to get the problem solving train to leave the station is to articulate. Thanks! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|