[Seaside] Click, Replace and Submit

Alexander Lazarević laza at blobworks.com
Wed Aug 3 08:58:44 UTC 2011


2011/8/2 Lukas Renggli <renggli at gmail.com>

> This has nothing to do with JQuery and/or Seaside, this is just HTTP,
> HTML and JavaScript. The form submission is part of the browser event
> handling of the button, but your click handler interfers with this
> when you remove the button.
>

I guess I made some assumptions about how submit works instead. So I hacked
this piece of html (wow that felt strange) to see what could work.

<html><head><title>Demo</title></head>
<body>
<form name="Person" action="http://de.selfhtml.org/cgi-bin/formview.pl">
<input type="text" id="lastname" size="30">
<input id="save" type="submit" onclick="dosubmit()" value="Save">
</form>
<script>
function dosubmit() {
  var button = document.getElementById("save");
  var text = document.createElement("span");
  text.innerHTML = "Progress";
  button.parentNode.replaceChild(text, button);
  document.Person.submit();
}
</script>
</body>

This does *not* work. I guess I can't do a submit once I changed dom
structure of the form? So if that's not gonna work it's not gonna work using
Seaside either.

 >             onClick: ((html jQuery id: #submit) value: 'Processing';
> > attributeAt: #disabled put: #true);
>
> Not sure, but I would say that doesn't work either: disabled buttons
> typically do not trigger a form submission.
>

Oh, that works. Maybe because the dom structure of the form hasn't changed
only some attributes?


> Also, why do you write '#true' instead of 'true'?
>

True. What was I thinking! ;)
I have to admit, that I still feel a bit confused about the jQuery, JS, Ajax
stuff, so I thought setting some attribute "directly" needs to have a
"literal" true.

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110803/85179066/attachment.htm


More information about the seaside mailing list