I am using a php script to have users sign up for our mailing list. The script is working perfectly if I don't use a rollover image as my submit button. Once I use a rollover image as the submit button using javascript inputed by Dreamweaver, I get an error saying "Object does not support this property or method".

The mailing list script I'm using is located at www.round-tree.com/index2.html

This is the code I'm using for the rollover image:

<a href="javascript:window.document.list.submit();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('submit','','navigation/submit_on.gif',1)"><img src="navigation/submit_off.gif" name="submit" width="49" height="21" border="0"></a></td>
                    <input type="hidden" name="form" value="list">

and this is the code without the rollover image:

<a href="javascript:window.document.list.submit();"><img src="navigation/submit_off.gif" width="49" height="21" border="0"></a></td>
                    <input type="hidden" name="form" value="list">

Any ideas as to why it won't work with the submit button as a rollover image?

Thanks,
Scott

    java script =>javascript

    and
    window.document.list.submit();

    =>
    document.yourFormName.submit();
    OR
    this.form.submit(); // if you call this from element, othervise if you use function you must use first option

    <form name="yourFormName">

    <input type="hidden" name="list" value="1,2,3,4,5">
    // submit button
    </form>

      Thanks TTT, but I'm not real sure what you're telling me. Are you saying I should use one or the other? I'm not real sure what you mean by
      java script =>javascript

      and
      window.document.list.submit();

      Or should I just put that code you provided into my script and modify to call my form?

      Thanks for your help.

        okay, I get what you mean by java script => javascript. There should not be a space in between java and script.

        However no matter which way I try I still get the same error message when I try using a rollover image as my button.

        I have tried using:

        this.form.submit();
        this.list.submit();
        window.document.list.submit();

        <input type="hidden" name="form" value="list" id="list">
        <input type="hidden" name="list" value="list" id="list">

        Nothing seems to work.

        I am using frames on the index2.html page where I have a frame called "mailing" which displays mailingList.php which contains my form. Could the frames be screwing things up.

        Reason I ask, is because I used to have a old order form which uses rollover images as buttons and I am basically copying the code from it which worked on the other form but doesn't on this one. The old order form didn't contain frames.

        Thanks for your help.

          I've always done it like this, and it works everytime.

          <form action="somepage.php" method="post" name="Form1">
          <a href="something" onclick="document.Form1.submit();" onmouseover="document.Form1.SubmitIMG.src='Image2.jpg';" onmouseout="document.Form1.SubmitIMG.src='Image1.jpg';">
          	<img src="Image1.jpg" alt="" border="0" name="SubmitIMG">
          </a>
          </form>
          
            Write a Reply...