Hope to get away with this

Results 1 to 2 of 2

Thread: Hope to get away with this

  1. #1
    Join Date
    Dec 1969

    Default Hope to get away with this

    Friends, I guess this is a JavaScript question I went to that forum but found it quite dead so I thought of asking it here. Anyway here I go:<BR><BR>1.<BR><BR>function setcountry(val,val1)<BR>{<BR> for(j=5;j&#062;val1;j--)<BR> if(val1==1)<BR> {<BR> document.Form.origin(+j).options.selectedIndex = val<BR> }<BR>}<BR><BR>How do i get the value for J I guess my syntax is wrong. Can anybody help.<BR><BR>2.<BR><BR>What I want is: I have a dynamically generated row of dropdown list boxes. There is a text field when I write a number say 27 in the text field and press &#039;go&#039; the 1 row becomes 27 rows of dropdown listboxes. Now out of that 27 row of list boxes if on the first row of list box I select eg... third column which is "Origin" say the Origin I select is Brazil so the rest of the 26 fields should become Brazil. How do I do it ?<BR><BR>Thank you in advance<BR>Beginner<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Hope to get away with this

    Beginner,<BR><BR>Here&#039;s the corrected function. At least I think it&#039;s what you want to do:<BR><BR>function setcountry(val,val1) <BR>{ <BR>for(j=5;j&#062;val1;j--) <BR>if(val1==1) <BR>{ <BR>document.Form.origin[j].options.selectedIndex = val <BR>} <BR>} <BR><BR>As far as question2 you&#039;ll need to provide more code. I&#039;m unclear on why you&#039;d want 27 rows of dropdowns and I&#039;m having a hard time visualizing what this would even look like. My biggest question is why?<BR><BR>Peek

Posting Permissions

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