KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Missing onchange event on combobox

 
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
Bert
KiXforms Regular
KiXforms Regular


Joined: 06 Oct 2003
Posts: 56
Location: Netherlands

PostPosted: Mon Oct 06, 2003 8:56 pm    Post subject: Missing onchange event on combobox Reply with quote

I am missing the ONCHANGE event with the combobox.
I use this event to test all fields on a wizard form after a change on any field.
When all fields are non empty I enable a button to go to the next wizard screen.
See the following Kixlet:


Code:
$Form = createobject ("kixtart.form")
$Form.center
$text = $Form.controls.textbox ("", 50, 50, 200, 20)
$text.onchange = ";"
$combobox1 = $Form.controls.combobox ("", 50, 100, 200, 100)
$combobox1.list = "1"
$combobox1.onchange = ";"
$button = $Form.controls.button ("Next", 50, 150, 100, 20)
$button.onclick = "next_screen()"
$button.enabled = 0
$Form.show
while $Form.Visible
   $=Execute($Form.DoEvents())
   if $text.text <> "" and $combobox1.text <> ""
      $button.enabled = 1
   else
      $button.enabled = 0
   endif
Loop
function next_screen()
   $ = $Form.messagebox ("Going to the next screen", "", 128)
endfunction


The event is just filled with the comment character to give control back to the kix script when the event is triggered.
However the combobox never triggers the onchange event.

Typing in something in the combobox and then in the textbox enables the button.
typing in something in the textbox and then in the combobox has no effect.
Back to top
View user's profile Send private message
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Mon Oct 06, 2003 9:10 pm    Post subject: Reply with quote

How do you know that the event is not triggered? Did you actually assign a real function to the OnChange event so that something does happen? E.g.
Code:

$combobox1.onchange = "messagebox('message','title')"

_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Bert
KiXforms Regular
KiXforms Regular


Joined: 06 Oct 2003
Posts: 56
Location: Netherlands

PostPosted: Tue Oct 07, 2003 3:33 pm    Post subject: Reply with quote

Filling the onchange event with ";" does the job I need. The code is returned by $Form.Doevents() and then executed by the EXECUTE statement.
This does nothing but since control is back in the Kix script I can do some testing in the rest of the while loop.
It works fine with a Textbox.
As soon as the text in the Textbox is changed the onchange event is triggered and control is returned to the while loop.
This does not happen when changing the contents of the combobox.
If you perform a test with the code in my message you can see this happen. FIll in the combobox, go to the textbox and type something and then clear it.
Look what happens to the button.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group