Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help please with liveupdate and listboxes #9

Closed
WinterMUD opened this issue Jan 3, 2023 · 4 comments
Closed

Help please with liveupdate and listboxes #9

WinterMUD opened this issue Jan 3, 2023 · 4 comments

Comments

@WinterMUD
Copy link

I have two listboxes on the passage and I want to change content of the second listbox when option of the first listbox chosen. How to do this with your macros without page reloading?

@cyrusfirheir
Copy link
Owner

You could use the event that is used in the process. As an example:

<span id="controller-list">
  <<listbox "$one">>
    <!-- ... -->>
  <</listbox>>
</span>

<<liveblock>>
  <!-- stuff for second listbox -->
<</liveblock>>

<<done>>
  <<run $("#controller-list").on("change", function() {
    $(document).trigger(":liveupdate");
  })>>
<</done>>

@cyrusfirheir
Copy link
Owner

cyrusfirheir commented Jan 3, 2023

Future note: I have just set up community discussions for this project, and you can put up questions like these on there from now onwards.

@WinterMUD
Copy link
Author

WinterMUD commented Jan 3, 2023

Thanks! It works now. But it need to change 'change' on 'click'. Sorry for question in unaprepriate place, I'm not well understand Github system.

@cyrusfirheir
Copy link
Owner

It's no problem. I had not set up the discussions page before this, so is all good.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants