NetTalk Central

Author Topic: Buttons?  (Read 4359 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Buttons?
« on: June 07, 2012, 02:44:38 AM »

a) Where can find more detailed description on the button types?
eg. button, submit, reset, save, cancel etc...
What to use in what situation.

b) A button on a browse has "Other" button and this has a check box "send button click to server",
and I can embed some code to set a session var, but I don't find equivalent on a form?
If I set "Send new value to server" to true and embed code, it does to execute the code.

TIA for any pointers

Johan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Buttons?
« Reply #1 on: June 07, 2012, 03:28:04 AM »
>> button,

is an html <button> - use in most cases.

>> submit,

is an htm button, but "submits the form". Use when you explicitly want to submit (usually to a foreign site).

>> reset,

is an html "reset" button. I've never used it in a web app.

>> save, cancel etc...

mimics the generated for "save" and "Cancel" buttons

>> b) A button on a browse has "Other" button and this has a check box "send button click to server",  and I can embed some code to set a session var, but I don't find equivalent on a form?
If I set "Send new value to server" to true and embed code, it does to execute the code.

should - as long as the button doesn't have a URL, and is a type "button".

cheers
Bruce



JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: Buttons?
« Reply #2 on: June 07, 2012, 09:03:21 AM »


Hi Bruce

thanks for the info,
am still not getting it to work.

Is there perhaps an example that you recall that shows a button on a form with a bit of embedded code on it.

Situation as follows:
I have several memory forms,
each have entry fields and 1 or more buttons,
when a button is clicked it should
execute some code,
set session variables,
and then open either form A or form B based on the data.

Johan




Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Buttons?
« Reply #3 on: June 07, 2012, 10:12:17 AM »
>> Is there perhaps an example that you recall that shows a button on a form with a bit of embedded code on it.

lots of them - calculator example springs to mind.

>> when a button is clicked it should
>> execute some code,
>> set session variables,
>> and then open either form A or form B based on the data.

so, I'm guessing you've set the URL or Procedure for the button as well. In which case you're trying to "do 2 things at once" which isn't allowed because you can't guarantee the order.

What session value do you need to set? perhaps it should be passed to the form in another way?

Cheers
Bruce

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: Buttons?
« Reply #4 on: June 07, 2012, 12:39:04 PM »

Hi Bruce,

I found the buttons example, and the hidden server button.
Got that working.

I am busy with quite a few forms to handle logging in, mailing of forgotten passwords, new user registration, etc...
all the options.
The session variables is to flag what stage/level the user is in and to control enabling/disabling of tabs/fields/menu items.
Not even sure if this is the best way <g>

Back to the button problem, which is something I should solve either way.

Doing exactly the same in my app, as far as I can see anyway.
Granted I have been fiddling with the settings for quite sometime to try and see where I am going wrong.

Deleted all buttons, in case something is stuck somewhere.
created new ones.
Same problem, not firing the code, and the button stays greyed, similar to the process button, but as if the process is not completing.


Obrigado

Johan








JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: Buttons?
« Reply #5 on: June 07, 2012, 02:00:17 PM »

Hi Bruce

Debugged with Firebug,

says "element not found"

and there is a POST but no response.
Is this a formatting issue somewhere?

Johan