PDA

View Full Version : Popup form that sends data back to main page


htcilt
01-07-2010, 10:39 AM
Hi,

I have a search page that I'm trying to add a filter to. I require the same sort of functionality as ebay's filter i.e. user clicks 'choose more', the form opens in the centre of the screen but not a new browser window. The user clicks 'OK' and the page is refreshed (sql updated) with the filter options.

Are there any tutorials out there that can help me with this? I've had a good search of Google and on here, but I can find anything :(

Many Thanks.

htcilt
01-07-2010, 05:55 PM
I've managed to get something thrown together, but I cant figure out how to pass the variable (array) back to the parent page and refresh the sql.

Can anyone help with this part of the problem? I'm getting a bit deserate! :s

rnd me
01-08-2010, 12:11 AM
var myRay=[1,2,3,4];
opener.myRay=myRay;

would copy an array named myRay from a popup to it's parent...

technically, a bug in JS means you can't move arrays (or any constructed object) between windows, but browsers should handle it enough for your purposes.

without seeing any code, i can't really say how to "refresh the sql" once you pass the data...

htcilt
01-08-2010, 04:54 PM
Thanks for the reply.
I've given up with Ajax for now and I'm sticking to the traditional way of searching with $_POST. I'll revisit Ajax when I've understood the basics lol