Dynamic Form Submit/IFrame Display Problem

Posted on 2004-11-04
Last Modified: 2008-03-06
Hi Guys,
I have a dynamic form on my "VBSCRIPT" ASP page i have two problems..

- Problem 1 -
when the user selects their class from the list i want the form to post automactily...this works fine in Internet Explorer but in Netscape, Firefox and Opera it doesnt submit.... here is the code i am using for the form submit...

<script type="text/javascript">
function submitform()
       // submit the form

<form NAME="selectmyclass" action="classroster.asp" method="post">
      <select name="frmselectmyclass" onChange="submitform();">
        <option value="">Select Your Class
        <option value="1a">Class 1a</option>
        <option value="1b">Class 1b</option>
        <option value="1c">Class 1c </option>      

ive have my code live here ... basically i need the form to submit for all types of browsers...

- Problem 2 -
I have a fair few forms on the site and i dont want the user to see the names of these forms in the browser so i am I am using an IFRAME on my site to display the different internet explorer it looks fine... but in Netscape, Firefox and Opera the frame looks really really squashed...

any ideas on how to fix this two proboblems please?
Jay Eire
Question by:jay_eire
    LVL 5

    Accepted Solution

    This fixes your submitter:

    <script type="text/javascript">
    function submitform()
           // submit the form

    And this fixes your iframe size:
    <title>:: Class Test ::</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <table width="800" height="100%" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#000066">
        <td height="30"><h1><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif">EIRE WEB</font></h1></td>

        <td bgcolor="#FFFFFF"><iframe src="" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe></td>

    The syntax document.forms("formname") is not standard, it's an IE only feature. I think document.forms["forname"] would also work, but I tend to use document.forms.formname myself as I know it always works. Note it's case sensitive.

    AS for your iframe, it's height was set to be 100% of the div, which didn't have a fixed height. You could add style="margin-left:auto;margin-right:auto;" to your iframe to centre it, but since it's width 100, that's pretty much a waste of time.
    LVL 7

    Author Comment

    excellent works a treat! thanks mate.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now