Re: [ModalBox Group] Submitting Modal Form Classic ASP

404 views
Skip to first unread message

Justinas Urbanavicius

unread,
Jul 4, 2012, 1:46:07 PM7/4/12
to moda...@googlegroups.com
so just create an AJAX request and send the form serialized data, be sure to set onsubmit="return false" on the form.

On Wed, Jul 4, 2012 at 4:51 PM, Websplee <hms...@gmail.com> wrote:
Hi Everyone,

I googled for a solution to this but to no avail. 

I have an html form which is calling another form (lets call it form1) as a modalbox using the following syntax:-

<a id="cts_link1" name="cts_link1" href="/CTS/form1.asp" title="Form 1" onclick="Modalbox.show(this.href, {title: this.title, width: 800, height: 600, overlayClose: false }); return false;" /> FrmLink

Now in this loaded modalbox (form 1) I want to submit entered data and return to the calling/parent form whilst keeping any information that was typed on the parent form. 

Form 1 syntax looks like this:-

        <form  action="ProcessForm1.asp" class="niceform" method="post" id="Form1">
        <fieldset>
            <legend>Bio Information</legend>
            <dl>
                <dt><label for="A_Name">What is your name? (Caller may choose to be anonymous)</label></dt>
                <dd><input type="text" name="Name" id="Name" size="64" /></dd>
            </dl>        
            <dl>
                <dt><label for="A_POB">What is your place of birth?</label></dt>
                <dd><input type="text" name="A_POB" id="A_POB" size="64" /></dd>
            </dl>
        </fieldset>
        <fieldset class="action">
            <input type="submit" name="submit" id="submit" value="submit"/>            
        </fieldset>
        </form>

In summary, I would like to achieve these steps:-

1. Call a modalbox form 
2. Enter data in the form and hit submit
3. Return to the calling form without refreshing it.

Thanks,

Humphrey.
                             


--
You received this message because you are subscribed to the Google Groups "ModalBox" group.
To view this discussion on the web visit https://groups.google.com/d/msg/modalbox/-/09P1lX73Fi4J.
To post to this group, send email to moda...@googlegroups.com.
To unsubscribe from this group, send email to modalbox+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/modalbox?hl=en.



--
Justinas

Websplee

unread,
Jul 5, 2012, 4:14:15 PM7/5/12
to moda...@googlegroups.com
Hi Gamesh,

Thanks for your response. Could you though slightly expand your response with a line of code or some sort of reference especially on the Ajax request. BTW am able to send the data all the way to the db but am ending up on the Process.asp blank page rather than returning to the parent form.

Thanks,

Humphrey.
To unsubscribe from this group, send email to modalbox+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/modalbox?hl=en.



--
Justinas

Justinas Urbanavicius

unread,
Jul 5, 2012, 4:32:31 PM7/5/12
to moda...@googlegroups.com
so if you get the data to the db then you are sending it somehow via regular post or AJAX. Don't know much about asp i'm more of the PHP guy :)
as for js code

new Ajax.Request('/some_url', {
  method: 'post',
  parameters: $('form-id').serialize(true)
  });
http://www.prototypejs.org/learn/introduction-to-ajax
http://api.prototypejs.org/dom/Form/serialize/

To view this discussion on the web visit https://groups.google.com/d/msg/modalbox/-/SNfD_ivqcJYJ.

To post to this group, send email to moda...@googlegroups.com.
To unsubscribe from this group, send email to modalbox+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/modalbox?hl=en.



--
Justinas

Websplee

unread,
Jul 5, 2012, 5:32:01 PM7/5/12
to moda...@googlegroups.com
Okay I see what you mean just been doing some tests. So I need a way to pick the serialized variables on the Process.asp which is proving something else with the Ajax call. Now will that automatically close the form and return to the parent?

Justinas Urbanavicius

unread,
Jul 5, 2012, 5:58:24 PM7/5/12
to moda...@googlegroups.com
i think closing the form and returning to the parent is up to you, just invoke modalbox's hide method

http://code.google.com/p/modalbox/wiki/CallBacks

To view this discussion on the web visit https://groups.google.com/d/msg/modalbox/-/XQVy2INeslkJ.

To post to this group, send email to moda...@googlegroups.com.
To unsubscribe from this group, send email to modalbox+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/modalbox?hl=en.



--
Justinas

Websplee

unread,
Jul 5, 2012, 6:11:54 PM7/5/12
to moda...@googlegroups.com
Thank you! I still have to find a way of having the params method work on some of the values so let me research into an asp equivalent of the php $GET.

Websplee

unread,
Jul 5, 2012, 6:30:12 PM7/5/12
to moda...@googlegroups.com
Or my question should be how do I query the string passed on to the other form using the Ajax.Request?

Justinas Urbanavicius

unread,
Jul 5, 2012, 6:49:17 PM7/5/12
to moda...@googlegroups.com
i'm not really sure what you meant to say by that

To view this discussion on the web visit https://groups.google.com/d/msg/modalbox/-/HCVt4VHJRowJ.

To post to this group, send email to moda...@googlegroups.com.
To unsubscribe from this group, send email to modalbox+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/modalbox?hl=en.



--
Justinas

Reply all
Reply to author
Forward
0 new messages