NetTalk Central

Author Topic: NTWS UpdateForm Click Button to call NetWebSource and pass parameters  (Read 6237 times)

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Would like to click on the Register button on NetWebForm to call a NetWebSource and at the same time pass contents of some of the already entered fields as p;arameters,

Looks like I cannot do this
'peopleguid='&tpe:guid,'peoplecellno='&tpe:cellno,'peopleemail='&tpe:email,'peoplepassword='&tpe:password
Only one parameter at a time then?

Or which embed point can I use for Register button to try and achieve this.
I would like to send SMS/email to the person busy registering use his already entered email and cellno.
Or can by clicking Register button the form can be saved and only pass the peopleguid to Source? Then with code there I get Fetch the fields from DB?
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: NTWS UpdateForm Click Button to call NetWebSource and pass parameters
« Reply #1 on: April 24, 2018, 06:02:17 PM »
Hi Zohan,

You can do this but you must pass this information in a way which conforms to URL syntax.

eg:

'peopleguid='&CLIP(tpe:guid)&'&peoplecellno='&CLIP(tpe:cellno)&'&peopleemail='&CLIP(tpe:email)&'&peoplepassword='&CLIP(tpe:password)

I've used & instead of & incase this url is part of an ajax response.

Also, you should obviously not pass the password in a URL.

To read this information on the receiving side, use p_web.GetValue('peopleguid') etc.

I'd look at using the session variables to do this as it will obsticate what you are up to (this will only work if its the same NetTalk web server). Otherwise i'd encrypt it.

Regards
Bill

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NTWS UpdateForm Click Button to call NetWebSource and pass parameters
« Reply #2 on: April 24, 2018, 10:54:44 PM »
Hi Johan,

You're mixing a bunch of things together here, and are not, I think making this as simple as it can be.
For example;

>> Would like to click on the Register button on NetWebForm to call a NetWebSource

Buttons don't call a NetWebSource. They call a Page (or something that mimics a page, like a browse, form or report). NetWebSource is not one of those. Alternativly buttons call "Server side code" where of course you can then call a regular Source procedure is you like.

>> and at the same time pass contents of some of the already entered fields as parameters,

You don't need to do this. Already entered fields are already in the session queue. So your source procedure can get them directly from there.

>> I would like to send SMS/email to the person busy registering use his already entered email and cellno.
Or can by clicking Register button the form can be saved and only pass the peopleguid to Source? Then with code there I get Fetch the fields from DB?

Check out the Example "Send email from a browser (11)". This triggers a Send on the form's "Save" button, which is perhaps what you are wanting to do as well.

cheers
Bruce


Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: NTWS UpdateForm Click Button to call NetWebSource and pass parameters
« Reply #3 on: April 25, 2018, 12:38:37 AM »
None of these embed points work for me.


Where can I put code that will execute when I click SendPassword button on a form.
To send and email and/or sms.
I would prefer to send sms/email from the SendPassword button and not from the Save button, if at all possible.
Then the person must enter the sent password in loc:password and be compared to the already generated tpe:password (ts.random(4)), if it is a match he can carry on, entering the rest of the fields on form and then Save?

OR - the person enters everything and clicks Save - his Username and Password is then sent to him via SMS/email.

How do I prevent a person from sitting down and registering countless phantom profiles?

Have just tried doing it from Save Button, but my embed code in validate updated is not executed? DAMN!
« Last Edit: April 25, 2018, 03:09:41 AM by Johan van Zyl »
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: NTWS UpdateForm Click Button to call NetWebSource and pass parameters
« Reply #4 on: April 25, 2018, 03:34:43 AM »
Hi Johan,

Bruce is right, I answered your question, but i missed the fact that you were trying to sent it to a NetWebSource, its really only for hard core stuff. So i probably just made it worse.

I think you are struggling with adapting your thinking to the flow of programming for the web, and it is a real challenge, but you'll get used to it.

There may be other ways, but here is a suggestion to send the email from a button:

1. Create a new memory form, add a display field, that says "we've just sent you an email" or similar. Give it a close only button.

2. On your other form, add the send email button and on the button action call this new memory form as a popup.

It will give your customer a nice message and it will allow you to do stuff like you would inside an embed point in a windows program.

You can now use an embed point on the new form to send your email/sms etc. You'll be able to read the value of fields on your other form via the session queue.

Regards
Bill





« Last Edit: April 25, 2018, 03:39:06 AM by bshields »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NTWS UpdateForm Click Button to call NetWebSource and pass parameters
« Reply #5 on: April 25, 2018, 04:51:16 AM »
Hi Johan,

Join us at he user group webinar on Thursday and we can step through this with you.

cheers
Bruce

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: NTWS UpdateForm Click Button to call NetWebSource and pass parameters
« Reply #6 on: April 25, 2018, 04:54:25 AM »
Great! Thx!
Should I not get an email invitation to join the webinar?
And I have to register?
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile