NetTalk Central

Author Topic: enable or disable the Insert button of a child browse  (Read 3352 times)

golmedo

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
enable or disable the Insert button of a child browse
« on: May 28, 2014, 12:20:52 PM »
I have the following question:
I want to enable or disable the Insert button of a child browse, depending on whether all fields in the parent form are completed...
The browse on form scheme in my WebServer is:

parent_process_form.fields1
parent_process_form.fields2
parent_process_form.child_process_browse (embed)
parent_process_form.child_process_browse.Insertbutton <--(IF parent_process_form.fields1 and parent_process_form.fields2 THEN enable(child_process_browse.Insertbuttonn) ELSE (disable(child_process_browse.Insertbutton)) )

I want to change the enable/disable state of the button without reloading the page...

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: enable or disable the Insert button of a child browse
« Reply #1 on: May 29, 2014, 12:51:12 AM »
Hi Gustavo,

Ok, I think it's do-able, although I haven't tried it specifically.

a) set a condition for the Insert button on the child Browse. Say something like
p_web.GetSessionValue('okToInsert') = 1

b) On the parent form, set the sessionValue to be 0 when the form is generated. ie in GenerateForm routine;
p_web.SetSessionValue('okToInsert',0)

c) For each of the form fields that must be set, in the validate::FieldEquate routine put something like
if p_web.GetSessionValue('fil:fields1') and p_web.GetSessionValue('fil:fields2') and ....
  p_web.SetSessionValue('okToInsert',1)
end


d) For each of the fields in ( c) add the Browse to the "Reset List" for that field.

Cheers
Bruce