View Single Post
  #11 (permalink)  
Old Sep 25th, 2007, 11:20
Rakuli's Avatar
Rakuli Rakuli is offline
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Field validation and changing display properties...

okay, sorry I understand now. I thought you would have just had one link that swapped the divs. I didn't realise you had a different link for each.

You could change the function like this

Code: Select all
function toggleProceed(fields, proceedLink)
{

// Loop through the array of id's to check
  for (i = 0; i < fields.length; i++)
      if (document.getElementById(fields[i]).value == "")
       
      {   // if no value, the reset link to hidden and exit from function
          document.getElementById(proceedLink).style.visibility = 'hidden';
          return;
       }

   // If we made it here we can show the link
   document.getElementById(proceedLink).style.visibility = 'visible';

}
Now when you call the function use onkeyup="toggleProceed(new Array('id'), 'idofproceedlink')"

I hope that's what you mean.

Cheers