Jump to content


Photo

POST vars not getting to popup


  • Please log in to reply
5 replies to this topic

#1 mikeh623

mikeh623
  • Members
  • Pip
  • Newbie
  • 7 posts

Posted 04 May 2006 - 03:14 PM

Okay, I have a form with a dropdown and a submit button. Its action attribute calls a javascript function which opens a popup, the popup has the php script that will handle the choice made in the dropdown of the previews/parent window. The problem is, the POST vars aren't being passed to the child popup, I'm pretty sure I know why, I'm just not sure at all what to do about it, like any solutions w/o drastically changing the methodology.

Thanks for any and all help!

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 04 May 2006 - 03:26 PM

You're going to have to be a little more clear on how you're passing the vars.

Does the page submit to another page that opens the pop-up, or are you opening the pop-up from the same page?

If it's the first, you have to make sure that you're filling the javascript function with the posted variables before you open the pop-up.

If it's the second, you can't use POST variables that way. You'll have to use JS to extract the data out of the form elements.

Info: PHP Manual


#3 mikeh623

mikeh623
  • Members
  • Pip
  • Newbie
  • 7 posts

Posted 04 May 2006 - 03:37 PM

Unfortunately, I'm using the form to open the popup. action="javascript: add_player() ;"

So, I knew why the variables weren't going. How would I use js to extract the variables and then use php to manipulate them considering server side and client side, I really don't want to involve ajax here, its just a small feature in this grand project.

Any ideas/suggestions so this doesn't become unnecessarily convoluted?

#4 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 04 May 2006 - 03:40 PM

You can easily grab the values out of the form with Javascript before opening the pop-up.

If you're unsure how, post in the Javascript board and someone should be able to help you.

Info: PHP Manual


#5 mikeh623

mikeh623
  • Members
  • Pip
  • Newbie
  • 7 posts

Posted 04 May 2006 - 03:49 PM

Thanks, I posted there.

#6 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 04 May 2006 - 06:05 PM

I just posted a fix in another post. look here

[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=92757\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=92757[/a]

Ray




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users