NetTalk Central

Author Topic: Single Insert Form and Chaining  (Read 3732 times)

TimR

  • Newbie
  • *
  • Posts: 28
    • View Profile
Single Insert Form and Chaining
« on: January 29, 2009, 05:02:44 PM »
I have a (memory) form that that gets prefilled by another web site.  When the user clicks on the save button it is supposed to insert several records and then return to an external page that is in one of the posted fields. 
With IE7 this works, however with IE6 it is not working.  Instead the beginning of the supplied address (i.e. www.whatever.com) is dropped and www.whatever.com/somepage.asp becomes www.myserveraddress.com/somepage.asp.  Which fails.

I looked at trying to use the "Chain_to" variable or setting the "URL on Save" and it then navigates correctly, but then ceases to go thru the PostUpdate and ValidateAll routines, which is where I write the records and validate the record.  Why does it do that?

Am I doing something wrong, or thoughts on how to get this to work will be greatly appreciated.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11179
    • View Profile
Re: Single Insert Form and Chaining
« Reply #1 on: January 29, 2009, 10:33:14 PM »
Hi Tim,

the fact that it works in one browser, and not the other, makes me think that there may be a difference on the browser side. I suppose the first step is to fully qualify the url. ie

http://www.whatever.com not just www.whatever.com

>> I have a (memory) form that that gets prefilled by another web site. 

pre-filled how exactly?

>> When the user clicks on the save button it is supposed to insert several records and then return to an external page that is in one of the posted fields.

Ok, there's some misconception here as to how web servers work.

When the user clicks on the save button a POST is done to a server.
At this point the browser has opened a connection to _your_ server, and can thus only receive a page from _your_ server. (I'm assuming the URL on save is pointing at your server.)

You server can't return a "site from another server" - at least not without a fair bit of effort. It _can_ return a redirection which takes the user to another server, but that may or may not be desirable. What you can also return is a page saying "records inserted, click here to continue" putting the URL of the other site under the here.

But let me know more what you have in mind, and what you're currently doing, and I can be more specific.

Cheers
Bruce


TimR

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Single Insert Form and Chaining
« Reply #2 on: January 30, 2009, 09:13:57 AM »
The URL is Fully Qualified.

  Desired System Overview:  Someone at a call center enters the data into their own web site/database. Another person does some QA on it, submits it to my web server (nettalk a single page)  saves the record and finally is redirected back to a page on the call centers server (address is supplied in Posted data to my server)

I read the data like this (to prefill form):
IF p_web.IfExistsValue('FirstName')
    p_web.StoreValue('FirstName')
End

I'm fairly certain my terminology is off, and that I'm definately learning as I go.  So if I'm doing something incorrectly or you have a better way to accomplish them I'm open to ideas. 

Thanks,
Tim

TimR

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Single Insert Form and Chaining
« Reply #3 on: January 30, 2009, 10:00:18 AM »
Almost forgot, Why does the postupdate and validateall routines get skipped if something is entered into the "URL on Save:" field in the template?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11179
    • View Profile
Re: Single Insert Form and Chaining
« Reply #4 on: February 01, 2009, 07:55:19 AM »
Is the URL on the save button pointing to a different site?

Cheers
Bruce

TimR

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Single Insert Form and Chaining
« Reply #5 on: February 02, 2009, 08:22:31 AM »
Not currently, as then the postupdate code gets skipped.

TimR

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Single Insert Form and Chaining
« Reply #6 on: February 03, 2009, 02:29:00 PM »
Here is the code for the save button

button type="button" name="save_btn" id="save_btn" value="Save" class="MainButton" onclick="document.Entry_frm.action='indexpage'; document.Entry_frm.target='_self'; dsb(Entry_frm,save_btn,'save_btn','','');" title="Click on this to Save the form" >Save</button>


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11179
    • View Profile
Re: Single Insert Form and Chaining
« Reply #7 on: February 04, 2009, 06:34:28 AM »
yes, if the url on the save button points to a different site, then the "form code" will get skipped.

simply because the request goes to the foreign server, and not to your server. Since your server doesn't get the request, it's hard to do anything with(out) it <g>.

Cheers
Bruce