[Seaside] Re: I would like to attach an onClick event according to
Fritz Schenk
intrader.intrader at gmail.com
Sat Feb 5 19:42:16 UTC 2011
Thanks John, unfortunately your code also suffers from the same problem
<requirement>
<button onClick="$('#external_links a').click(function() {
return confirm('You are going to visit: ' + this.href);
});" type="submit" class="submit">Attach Click</button>
"The confirm returns true or false controlling the action of the anchor. Very
simple to say this in JavaScript. See http://jsbin.com/imuka5/2"
</requirement>
Not so simple in Seaside as we need to work around the double quotes that the
onClick message uses.
<generated Seaside source>
<button onclick="$("#external_links a").click(function(){return confirm
("Your are going to visit: " + this.href)})" type="submit"
class="submit">Attach Click</button>
</generated Seaside source>
See the nested double quotes.
By the way, your code generates exactly the same html as
<exactly same html as your code>
onClick: ((html jQuery expression: 'external_links a')
onClick: 'return confirm("You are going to visit: "+ this.href)');
with: 'Attach Click'
</exactly same html as your code>
Sorry, and thanks again
More information about the seaside
mailing list