div woes

JavaScript and client side scripting.

Moderator: General Moderators

User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

neither of those worked neophyte :( . this is kinda like the firefox iframe height problem where if you go to a smaller page it does not collapse back, it stays really big. i don't quite remember that problem but I remember dealing with it.

the javascript deal is because you cant give a form a name, atleast that is what the w3c things where telling me, so I gave it a ID and all the javascript still works, i don't know whats up with that.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

huff.. huff..
I.. have... done.. it.. for .. you..
*falls down exhausted*

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>

<BODY>
<form id="myform" action="whatever.php">
<table id="info" border="1" align="left" cellpadding="4" cellspacing="0">
    <!-- PAGE CONTENT GOES HERE -->
    <tr>
      <td class="text">
        <br /><br /><b><font color="red">What will you be booking?</font></b>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td class="text">
        Vehicles/Transportation
      </td>
      <td class="text">
        <input type="radio" name="usage" value="vehicles" onclick="if (this.form.usage[0].checked){ show_veh(); hide_mdl(); }else{ hide_veh(); }" />
      </td>
    </tr>
    <tr>
      <td class="text">
        Models/Talent
      </td>
      <td class="text">
        <input type="radio" name="usage" value="models" onclick="if (this.form.usage[1].checked){ show_mdl(); hide_veh(); }else{ hide_mld(); }" />
      </td>
    </tr>
    <tr>
      <td class="text" colspan="2">
        <b><font color="red">Reference #1</font></b>
      </td>
    </tr>
    <tr>
      <td class="text" width="33%">
        <font color="red">Production Company/Studio:</font>
      </td>
      <td class="text" width="67%">
        <input type="text" name="agency1" size="20" />
      </td>
    </tr>
    <tr>
      <td class="text">
        <font color="red">Phone Number:</font>
      </td>
      <td class="text">
        <input type="text" name="phone1" size="20" />
      </td>
    </tr>
    <tr>
      <td class="text">
        <font color="red">Contact Name:</font>
      </td>
      <td class="text">
        <input type="text" name="name1" size="20" />
      </td>
    </tr>
    <tr>
      <td class="text">
        <br /><br /><b>Are there current assignments where you can use our Vehicle Booking System?</b>
      </td>
      <td class="text">
        <br /><br />Yes:<input type="radio" name="veh_curr" value="yes" onclick="if (this.form.veh_curr[0].checked){ show_veh_now(); }else{ hide_veh_now(); }" /> &nbsp; No:<input type="radio" name="veh_curr" value="no" onclick="if (this.form.veh_curr[1].checked){ hide_veh_now(); }else{ show_veh_now(); }" />
      </td>
    </tr>
    <tr>
      <td class="text">
        <font color="red">Date:</font>
      </td>
      <td class="text">
        <input type="text" name="date_pres" size="20" />
      </td>
    </tr>
    <tr>
      <td class="text">
        <font color="red">Location:</font>
      </td>
      <td class="text">
        <input type="text" name="loc_pres" size="20" />
      </td>
    </tr>
    <tr>
      <td class="text">
        Why Not?:
      </td>
      <td class="text">
        <textarea name="nowhy_p" rows="5" cols="5"></textarea>
      </td>
    </tr>
    <tr>
      <td class="text">
        <br /><br /><b>Are there future assignments where you can use our Vehicle Booking System?</b>
      </td>
      <td class="text">
        Yes: <input type="radio" name="veh_fut" value="yes" onclick="if (this.form.veh_fut[0].checked){ show_veh_fut(); }else{ hide_veh_fut(); }" /> &nbsp; No:<input type="radio" name="veh_fut" value="no" onclick="if (this.form.veh_fut[1].checked){ hide_veh_fut(); }else{ show_veh_fut(); }" />
      </td>
    </tr>
    <tr>
      <td class="text">
        <font color="red">Date:</font>
      </td>
      <td class="text">
        <input type="text" name="date_fut" size="20" />
      </td>
    </tr>
    <tr>
      <td class="text">
        <font color="red">Location:</font>
      </td>
      <td class="text">
        <input type="text" name="loc_fut" size="20" />
      </td>
    </tr>
    <tr height="50px">
      <td class="text">
        Why Not?:
      </td>
      <td class="text">
        <textarea name="nowhy_f" rows="2" cols="5"></textarea>
      </td>
    </tr>
    <!-- START DIV FOR INVISIBLE VEHICLES -->
    <tr>
      <td class="text" width="33%">
        <b>Bookers For Vehicles</b>
      </td>
      <td class="text" width="67%">
      </td>
    </tr>
    <tr>
      <td class="text">
        Approximate number of cars needed per month:
      </td>
      <td class="text">
        <input type="text" name="cars_month" size="3" />
      </td>
    </tr>
    <tr>
      <td class="text">
        Approximatly how many days each month:
      </td>
      <td class="text">
        <input type="text" name="cars_days" size="3" />
      </td>
    </tr>
    <tr>
      <td class="text">
        <b>Average cost per day for:</b>
      </td>
      <td class="text">&nbsp;</td>
    </tr>
    <tr>
      <td class="text">
        Background cars:
      </td>
      <td class="text">
        $<input type="text" name="bg_cars" size="3" />
      </td>
    </tr>
    <tr>
      <td class="text">
        Luxury cars:
      </td>
      <td class="text">
        $<input type="text" name="lux_cars" size="3" />
      </td>
    </tr>
    <tr>
      <td class="text">
        Specialty cars:
      </td>
      <td class="text">
        $<input type="text" name="spec_cars" size="3" />
      </td>
    </tr>
    <!-- END VEHICLE INVISIBLE DIV -->
    <tr>
      <td class="text">
        <b>Bookers For Models</b>
      </td>
      <td class="text">
      </td>
    </tr>
    <tr>
      <td class="text">
        Approximate number of extras needed per month:
      </td>
      <td class="text">
        <input type="text" name="extras_month" size="3" />
      </td>
    </tr>
    <tr>
      <td class="text">
        Approximate number of models needed per month:
      </td>
      <td class="text">
        <input type="text" name="models_month" size="3" />
      </td>
    </tr>
    <tr>
      <td class="text">
        <b>Please indicate your hourly rate for Background/extra's:</b>
      </td>
      <td class="text">
      </td>
    </tr>
    <tr>
      <td class="text">
        Union:
      </td>
      <td class="text">
        <input type="text" name="union" size="3" />
      </td>
    </tr>
    <tr>
      <td class="text">
        Non-union:
      <td class="text">
        <input type="text" name="non_union" size="3" />
      </td>
    </tr>
    <tr>
      <td class="text">
        <b>Please indicate your hourly rate for Modeling:</b>
      </td>
      <td class="text">
      </td>
    </tr>
    <tr>
      <td class="text">
        Commercial:
      </td>
      <td class="text">
        <input type="text" name="commercial" size="3" />
      </td>
    </tr>
    <tr>
      <td class="text">
        Fashion/runway:
      </td>
      <td class="text">
        <input type="text" name="fashion" size="3" />
      </td>
    </tr>
    <tr>
      <td class="text">
        Editorial:
      </td>
      <td class="text">
        <input type="text" name="editorial" size="3" />
      </td>
    </tr>
    <tr>
      <td class="text">
        Promotional:
      </td>
      <td class="text">
        <input type="text" name="promotional" size="3" />
      </td>
    </tr>
    <!-- END MODELS INVISIBLE DIV -->
    <tr>
      <td class="text" colspan="2">
        <input type="submit" name="submit" value="SUBMIT" />
      </td>
    </tr>
    <!-- PAGE CONTENT ENDS HERE -->
</table>
</form>

<script type="text/javascript">
Tbl = document.getElementById("info");

Tbl.rows[8].style.display = "none";
Tbl.rows[9].style.display = "none";
Tbl.rows[10].style.display = "none";
//done with first part

//Tbl.rows[12].style.display = "none";
//Tbl.rows[13].style.display = "none";
//Tbl.rows[14].style.display = "none";
//second part

Tbl.rows[15].style.display = "none";
Tbl.rows[16].style.display = "none";
Tbl.rows[17].style.display = "none";
Tbl.rows[18].style.display = "none";
Tbl.rows[19].style.display = "none";
Tbl.rows[20].style.display = "none";
Tbl.rows[21].style.display = "none";
//third part

Tbl.rows[22].style.display = "none";
Tbl.rows[23].style.display = "none";
Tbl.rows[24].style.display = "none";
Tbl.rows[25].style.display = "none";
Tbl.rows[26].style.display = "none";
Tbl.rows[27].style.display = "none";
Tbl.rows[28].style.display = "none";
Tbl.rows[29].style.display = "none";
Tbl.rows[30].style.display = "none";
Tbl.rows[31].style.display = "none";
Tbl.rows[32].style.display = "none";
//fourth part

function show_veh_now()
{
    Tbl.rows[8].style.display = "";
    Tbl.rows[9].style.display = "";
    Tbl.rows[10].style.display = "none";
}
function hide_veh_now()
{
    Tbl.rows[8].style.display = "none";
    Tbl.rows[9].style.display = "none";
    Tbl.rows[10].style.display = "";
}

function show_veh_fut()
{
    Tbl.rows[12].style.display = "";
    Tbl.rows[13].style.display = "";
    Tbl.rows[14].style.display = "none";
}
function hide_veh_fut()
{
    Tbl.rows[12].style.display = "none";
    Tbl.rows[13].style.display = "none";
    Tbl.rows[14].style.display = "";
}

function show_veh()
{
    Tbl.rows[15].style.display = "";
    Tbl.rows[16].style.display = "";
    Tbl.rows[17].style.display = "";
    Tbl.rows[18].style.display = "";
    Tbl.rows[19].style.display = "";
    Tbl.rows[20].style.display = "";
    Tbl.rows[21].style.display = "";
}
function show_mdl()
{
    Tbl.rows[22].style.display = "";
    Tbl.rows[23].style.display = "";
    Tbl.rows[24].style.display = "";
    Tbl.rows[25].style.display = "";
    Tbl.rows[26].style.display = "";
    Tbl.rows[27].style.display = "";
    Tbl.rows[28].style.display = "";
    Tbl.rows[29].style.display = "";
    Tbl.rows[30].style.display = "";
    Tbl.rows[31].style.display = "";
    Tbl.rows[32].style.display = "";
}

function hide_veh()
{
    Tbl.rows[15].style.display = "none";
    Tbl.rows[16].style.display = "none";
    Tbl.rows[17].style.display = "none";
    Tbl.rows[18].style.display = "none";
    Tbl.rows[19].style.display = "none";
    Tbl.rows[20].style.display = "none";
    Tbl.rows[21].style.display = "none";
}
function hide_mdl()
{
    Tbl.rows[22].style.display = "none";
    Tbl.rows[23].style.display = "none";
    Tbl.rows[24].style.display = "none";
    Tbl.rows[25].style.display = "none";
    Tbl.rows[26].style.display = "none";
    Tbl.rows[27].style.display = "none";
    Tbl.rows[28].style.display = "none";
    Tbl.rows[29].style.display = "none";
    Tbl.rows[30].style.display = "none";
    Tbl.rows[31].style.display = "none";
    Tbl.rows[32].style.display = "none";
}
</script>
</BODY>
</HTML>
was littered with errors, I tell you... didn't validate inspite of you saying you had corrected it. If you don't improve your coding, you will be burned someday 8O
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

whoa holy snap! works! beautiful! so in the end it was just up to changing the "block" to "" ...wow ok. how did it not validate? i used validator.w3.org and it said

This Page Is Tentatively Valid HTML 4.0 Transitional

and didnt give me any errors. why do you have to put <br /> isn't that just for xhtml or xml or somthing because it has to have a closing end tag? why would html have to have that?

anyway: THANK YOU VERY MUCH! the gods love you for sure.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

shiznatix wrote:whoa holy snap! works! beautiful! so in the end it was just up to changing the "block" to "" ...wow ok. how did it not validate? i used validator.w3.org and it said

This Page Is Tentatively Valid HTML 4.0 Transitional

and didnt give me any errors. why do you have to put <br /> isn't that just for xhtml or xml or somthing because it has to have a closing end tag? why would html have to have that?
i dunno... I validated it with my pet HTML 3.2 Tiny Validator and it said that DOCTYPE was unknown one... and your br & inputs were missing /... thats all..
shiznatix wrote:anyway: THANK YOU VERY MUCH! the gods love you for sure.
does Roja... :P
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

n00b Saibot wrote:i dunno... I validated it with my pet HTML 3.2 Tiny Validator and it said that DOCTYPE was unknown one... and your br & inputs were missing /... thats all..
Your pet is *wrong*. The closing tags (/) are, as shiz said, only for xhtml. The code you've produced is invalid code.

Always use the w3c validator for checking compliance. Anything else is someone else's guess at what is and isnt compliant - and they are often wrong.
n00b Saibot wrote:
shiznatix wrote:anyway: THANK YOU VERY MUCH! the gods love you for sure.
does Roja... :P
You solved the problem - nothing but love for that!
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

waah! my pet HTML 3.1 Tiny Validator is broke :cry:
is there any other offline validator that I can use :?:
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

n00b Saibot wrote:waah! my pet HTML 3.1 Tiny Validator is broke :cry:
is there any other offline validator that I can use :?:
Offline validators aren't very reliable. The firefox view-source html Tidy validator is fairly solid, but its no replacement for the real thing.

Not sure why you need an offline validator for validating webpages (grin), but I've never had much of a problem.

If the concern is that there are some pages you want to validate that aren't online (even if you are), thats a different issue - and one that has an EXCELLENT solution. Firefox's WebDeveloper Plugin has a Tools->Validate Local HTML (and Validate Local CSS too) that does exactly that, via the w3c page. Its *awesome*.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

That means no standalone Validator would do the job nicely :(

I've seen the supported DOCTYPES in my validator and it has only following ones
» HTML 2.0
» HTML 3.2
» HTML 4.01 Strict
» HTML 4.01 Transitional
» HTML 4.01 Frames
» XHTML 1.0 Strict
» XHTML 1.0 Transitional
» XHTML 1.0 Frames
» XHTML 1.1
» MathML 1.01
» MathML 2.0
» SVG 1.0
» SVG 1.1 Full
» SVG 1.1 Basic
» SVG 1.1 Tiny
» XHTML + MathML + SVG Profile (html)
» XHTML + MathML + SVG Profile (svg)

quite impressive list... huh? but NO SUPPORT FOR HTML loose aaaargh! :evil: I think thats why it is branding that as invalid.... :x
Post Reply