onChange() not firing everytime

Results 1 to 2 of 2

Thread: onChange() not firing everytime

  1. #1
    Join Date
    Dec 1969

    Default onChange() not firing everytime

    I have a form - within the form is an inline frame.<BR>Within the inline frame is another form - trust me this is necessary. What happens is that when the user selects an option from the drop down in the main page that value is passed to the inline frame. The inline frame queries a db based on the users selection and then populates a drop down (in the inline frame) with option values. When the user makes their selection from this second drop down, that selection is then passed to a hidden form field in the main document/form.<BR>This works fine! BUT on subsequent selections the hidden form fields value does not change unless the page is refreshed.<BR><BR>In a nutshell:<BR>User makes a selection from d/d1 this fires a javascript event which queries the db and populates d/d2 with the results.<BR>User makes a selection from d/d2 which also fires a JavaScript event which populates a hidden form field with the value of d/d2<BR>After all this the form fields are passed to a different page to build some SQL. However after the first (successful) run, subsequent attempts either pass the previous value or nothing at all. Anyone still reading this? anyone have an idea?<BR>I&#039;ll paste the JS and the events here if it helps.<BR>Cheers<BR>Jay<BR>&#060;select name="cats" onChange="popSubCat()"&#062;<BR>&#060;script language="JavaScript"&#062;<BR>function popSubCat()<BR>//populate the dropdown in the inline frame with sub cats once a cat is chosen<BR>{<BR>opt = document.form1.cats.value;<BR>document.all.getSubC ats.src = "EditWWSInline.asp?Cats=" + opt<BR>}<BR>&#060;/script&#062;<BR>================<BR>&#060;select name="subCats" onChange="parent.document.form1.getSubValue.value = document.form2.subCats.value;"&#062;<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Bill's mantra: DEBUG DEBUG DEBUG

    In this case:<BR><BR>&#060;select name="subCats" onChange="alert(&#039;onChange being invoked with &#039;+this.value);parent.document.form1.getSubVal ue.value=this.value;"&#062;<BR><BR>Does the onChange actually happen (do you get the alert?), or is the real problem that it is not firing.<BR><BR>You know, another way to accomplish this would be to have the onSubmit code in the main frame go read the value from this subordinate frame and plunk it into the hidden field at submit time. Then you aren&#039;t relying on the onChange, if that turns out to be the problem.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts