Alpha Video Training
Results 1 to 8 of 8

Thread: Submit form using ajax call back

  1. #1
    Member
    Real Name
    Ivan Lozano
    Join Date
    Apr 2013
    Location
    Azusa, CA. LA County
    Posts
    400

    Default Submit form using ajax call back

    I know this will sound odd and you may want to know why I would want to do this but, Is it possible to submit a ux form using an ajax callback?
    Heres what Ive got but its not working and I know Im using wrong syntax.

    Code:
    function saveOrRedirect as c (e as p)
    			dim nameSearchCount as n
    			nameSearchCount = e.dataSubmitted.nameSearchCount
    			
    			If nameSearchCount = 0 then
    				e.url = "http://www.google.com"
    			else
    				'Submit number of hits found
    				e.javascript = "{Dialog.Object}.submit();"
    			end if
    end function
    Last edited by Gustavo1478; 09-15-2016 at 04:56 PM.

  2. #2
    Member
    Real Name
    Nate Mitchell
    Join Date
    Feb 2013
    Location
    Lexington, KY
    Posts
    103

    Default Re: Submit form using ajax call back

    Yes, you can execute the submit method JS from an ajax callback.
    Change e.javascript to:

    Code:
    saveOrRedirect = "{Dialog.Object}.submit();"
    Nate Mitchell PMP

  3. #3
    Member
    Real Name
    Ivan Lozano
    Join Date
    Apr 2013
    Location
    Azusa, CA. LA County
    Posts
    400

    Default Re: Submit form using ajax call back

    Thank You nate, an I also using the wrong e.url command, Ive used this in afterdialogvalidate and works fine but its not working in my callback?

  4. #4
    Member
    Real Name
    Nate Mitchell
    Join Date
    Feb 2013
    Location
    Lexington, KY
    Posts
    103

    Default Re: Submit form using ajax call back

    Try this instead:

    Code:
    saveOrRedirect = <<%str%
    	window.open("http://www.google.com");
    	%str%
    Nate Mitchell PMP

  5. #5
    Member
    Real Name
    Ivan Lozano
    Join Date
    Apr 2013
    Location
    Azusa, CA. LA County
    Posts
    400

    Default Re: Submit form using ajax call back

    I think this is the right answer
    Code:
    saveOrRedirect = "window.open('http://www.google.com');"

  6. #6
    Member
    Real Name
    Ivan Lozano
    Join Date
    Apr 2013
    Location
    Azusa, CA. LA County
    Posts
    400

    Default Re: Submit form using ajax call back

    Oh looks like you beat me to it, thank you Nate.

  7. #7
    Member
    Real Name
    Ivan Lozano
    Join Date
    Apr 2013
    Location
    Azusa, CA. LA County
    Posts
    400

    Default Re: Submit form using ajax call back

    While that method does work, how can I get it to instead of redirecting in a new window, redirect in the current one?

  8. #8
    Member
    Real Name
    Nate Mitchell
    Join Date
    Feb 2013
    Location
    Lexington, KY
    Posts
    103

    Default Re: Submit form using ajax call back

    There are a number of optional properties for the open window method.
    Add the following to open in the current window.

    Code:
    window.open("http://www.w3schools.com", "_self");
    Nate Mitchell PMP

Similar Threads

  1. ajax call back failed inside grid
    By vagkomninos in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 12-26-2014, 11:56 AM
  2. Set Repeating Section Row Count During an Ajax Call Back
    By istuart in forum Application Server Version 11 - Web/Browser Applications
    Replies: 5
    Last Post: 01-15-2014, 11:38 AM
  3. Ajax Call Back - Add record issue
    By SteveK3003 in forum Application Server Version 11 - Web/Browser Applications
    Replies: 12
    Last Post: 09-05-2012, 12:10 PM
  4. Ajax Call back problem with 'e.V'
    By cFlat7 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 11-04-2010, 06:35 PM
  5. check box Selection Ajax Call Back
    By amarcelo in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 05-06-2010, 03:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •