I have built a standard form with a list of options using radio buttons.

The form is for internal use only but I still want to maintain standards and accessibility.

To improve the look of it for the client I have added some javascript which hides the buttons and uses onclick events on the labels so that the submit button doesn't need to be clicked.

This works fine on Firefox but does not work on IE with javascript enabled.

I did a search and found that there may be a conflict where there is a document.submit and a submit button in the html.

I tried removing the submit button using the DOM but that has no effect.

I was rather pleased to get this working on Firefox as its my first attempt at completely separating scripting and html.

Can anyone shed any light on this?

See code below.

=======

window.onload = initElement

function initElement() {
   var inputs,i;
   if (document.library_form) {
       inputs=document.getElementsByTagName('input')
        for(i=0;i<inputs.length;i++) {
            inputs[i].style.display = 'none'
            inputs[i].onclick = function() { submitform(); return false }
           }
       n = i - 1
       o = document.getElementById('library_form')
       p = o.getElementsByTagName('div')[n]
       o.removeChild(p)
       }
   }

function submitform() {
   document.getElementById('library_form').submit();
   }

========

Kind Regards
--
Chris Price

Choctaw

[EMAIL PROTECTED]
http://www.choctaw.co.uk

Tel. 01524 825 245
Mob. 0777 451 4488

Beauty is in the Eye of the Beholder
while Excellence is in the Hand of the Professional

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-+- Sent on behalf of Choctaw Media Ltd -+-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Choctaw Media Limited is a company
registered in England and Wales
with company number 04627649

Registered Office:
Lonsdale Partners,
Priory Close,
St Mary's Gate,
Lancaster LA1 1XB
United Kingdom




*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to