1
kalamata
Block Refreshing
  • 2007/2/26 19:20

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Dear All,

I want to put a form in a custom block and every time the user clicks on the Submit button, the content of the block will change according to the user input. One way of doing that is pointing the action to PHP_SELF and use $_GET to get the values of parameters. However, this seems to be bad practice as the whole page is reloaded and takes time and frustrates the user.

Is there any way that I can ask only the particular block to refresh its contents (in a way similar, say, to shoutbox)?

I look forward to hearing from you soon.

Thanks in advance.

George

2
Herko
Re: Block Refreshing
  • 2007/2/26 19:35

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Sure you can, use an iframe for the block, and reload the contents of the file the iframe calls.

Herko

3
Stewdio
Re: Block Refreshing
  • 2007/2/26 20:13

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


Simple, practical and OOTB. I like the way you think Herko!
XOOPS Community Support

4
kalamata
Re: Block Refreshing
  • 2007/2/27 21:05

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Quote:

Herko Coomans wrote:
Sure you can, use an iframe for the block, and reload the contents of the file the iframe calls.

Herko

Hi Herko,

Many thanks for your prompt reply. What do you do, however, in the case that the php function we are talking about is the one that generates the block and returns a block structure? Would the hack still work?

I look forward to hearing from you soon.

Thanks in advance.

George

5
kalamata
Re: Block Refreshing
  • 2007/3/1 11:45

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Quote:

kalamata wrote:
Quote:

Herko Coomans wrote:
Sure you can, use an iframe for the block, and reload the contents of the file the iframe calls.

Herko

Hi Herko,

Many thanks for your prompt reply. What do you do, however, in the case that the php function we are talking about is the one that generates the block and returns a block structure? Would the hack still work?

I look forward to hearing from you soon.

Thanks in advance.

George


Basically, what I want to do is use the Weather block provided by the vlweather module, but give the user the option to select looking at the weather of a number of cities. I have already implemented that using a drop-down list that submits to the page, but this has the disadvantage of reloading the whole page rather than just the block contents. Following what Herko said, does this mean the source of my iframe should be the weather template block?

Thanks,
George

Login

Who's Online

133 user(s) are online (86 user(s) are browsing Support Forums)


Members: 0


Guests: 133


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits