Hello everyone,
I've been working on a really fun project but today something got on
my nerves. I searched for some solutions but none worked for me. I
even found one post somewhere with something similar:
http://www.mooforum.net/general12/domready-after-request-html-t1743.html
So... There's a page with a bunch of rows on a table and each row as a
link "edit". On that page I add an event to each link when the user
clicks on it. This event makes a Request.HTML and the html response
will be set by the update option on a lightbox-like div, a better
looking pop up window. On this new page I have some input fields and
an input button which I want to be able to click to trigger an event
(a request to save the input fields).
Problem is: I can't add events on the pop up window!
Code-wise:
page.php
...
window.addEvent('domready', function()
{
...
$each($$('a.edit_venue_link'), function(item)
{
item.addEvent('click', function()
{
var venue_id = item.get('venue_id');
new Request.HTML(
{
url: '/admin/venue/' + venue_id,
update: 'edit_venue_box'
}).send();
}
);
}
);
...
/admin/view/:num (it's a controller which triggers a view with...)
...
<script>
window.addEvent('domready', function()
{
alert($('submit_button').get('text'));
$('submit_button').addEvent('click', function()
{
alert('is it working?');
});
...
The alert with the submit_button text works but all the events I try
to add don't.
Am I doing something wrong?
I tried setting evalScripts true and false but it still doesn't work.
The solution on the link I wrote about doesn't work either...