Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Monday, February 27th, 2006

Time Event
11:01a
To scroll or not to scroll...
I was wondering if there's a simple way (by adding to the code below) to make the popup page have scroll bars?
Code behind cut...Collapse )
11:07a
Finding the value of a pull-down menu
I've been working on my huge form some more and I think I've narrowed down at least one of the problems to the following code:
function updateReg() {
    var title = "";
    var dateIndex = calculateDate();
    RegFees = 0;
    for(i=1;i<=4;i++)
     {
      var which = "document.form1.cat"+i;
      var sel = eval(which+".selectedIndex");
      alert("i = " + i + ", sel = " + sel);
      var t = eval(which+".options["+sel+"].value");
      alert("i = " + i + ", t = " + t);
      if(t != "--Choose One--")
       {
        title += "R"+i+" - "+t+" - $"+Categories[sel][dateIndex]+".00\n";
        RegFees += Categories[sel][dateIndex];
       }
     }
    document.form1.reg_title.value = title;
    updateTotal();
}


Especially this line:
var t = eval(which+".options["+eval(which+".selectedIndex")+"].value");


It works fine in Firefox but in IE I keep getting t="" instead of the value of the cat1 (cat2, etc) menu.
8:43p
Raw Noobage - Problem Solved!
I'm very new to Javascript, and am trying to figure out how to do some form validation with an event handler. Don't worry, I'm doing this in my spare time, not for pay. =P

I figured out how to make this work, so if anyone is interested please check it out beneath the LJ cut.

Making Errors Appear on the PageCollapse )

Thanks to Imagescimon for helping me figure this out!

Current Mood: Image confused

<< Previous Day 2006/02/27
[Calendar]
Next Day >>
About LiveJournal.com
Image