Hi Bryon -
It does seem that one more example that illustrated this would be of
benefit. I just got past this a few days ago with help from this list.
In order to post the form, you can put something similar to the
following within your ok: function
var win = Windows.focusedWindow;
var data = Form.serialize(win.getId());
var opt = {
method: 'post',
postBody: data,
onSuccess: function(originalRequest) {
fn_to_handle_server_response(originalRequest.responseText);
Dialog.closeInfo();
}
}
new Ajax.Request(url_to_post_contents_of_form_to, opt);
hth...
Tom
Bryon Westmoreland wrote:
> Hello,
>
> I'm very new to the Prototype Window Class and Prototype in general, so
> forgive the stupid question:
>
> I would like to create a popup window similar to the login sample provided
> on the prototype-window.xilinus.com/
> <http://prototype-window.xilinus.com/> site. I would like the form to
> be able
> to post data to the server and also receive validation error messages back
> from the processing page. How would I go about posting a form in this
> popup
> to a server side script and receiving any information back from the
> script?
> I'm able to get the login sample working fine, but I'm lost as to how to
> submit a form and also how to return error messages if validation of the
> form fails.
>
> Here's a sample of my code:
>
> The javascript:
> -------------------
> function addLink(){
> Dialog.confirm($('addLink').innerHTML, {windowParameters:
> {className:"alphacube", width:400},
> okLabel: "Add Link",
> cancelLabel: "Cancel",
> ok:function(win){
> $('addLink_error_msg').innerHTML='Error adding link.';
> $('addLink_error_msg').show();
> Windows.focusedWindow.updateHeight();
> return false;}});
> }
>
> And the form:
> -------------------
> <div id="addLink" style="display:none">
> <form name="myForm" action=" addlink.cfm">
> <p><span id='addLink_error_msg' class="addLink_error"
> style="display:none"> </span></p>
> <div style="clear:both"></div>
> <p><span class="addLink_label">URL</span> <span
> class="addLink_input"><input type="text" name="url"/></span></p>
> <div style="clear:both"></div>
> <p><span class="addLink_label">Title</span> <span
> class="addLink_input"><input type="text" name="title"/></span></p>
> <div style="clear:both"></div>
> </form>
> </div>
>
> I appreciate any help that anyone can offer.
>
> Regards,
>
> westy
> ------------------------------------------------------------------------
>
> _______________________________________________
> Javawin mailing list
> [email protected]
> http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com
>
_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com