?
Solved

Updating table widths in JavaScript

Posted on 2004-10-25
8
Medium Priority
?
479 Views
Last Modified: 2012-06-27
I have this code:
<td colspan=3 align=center>
<script language="JavaScript">
<!--
function setJS() {
document.QuestionEntry.JavaScript.value = "true";
document.QuestionEntry.Target.value = "he/queryPost";
}
// Just in case the JS from the broker can't be loaded
function addOnlineReps() {
document.write('<option value="-1" selected>First available');
}
//-->
</script>
<script language="JavaScript" src="http://broker.gotoassist.com/servlet/com.ec.expertbroker.servlets.OnlineExpertsServlet?Portal=rockctech"></script>
<form action="http://broker.desktopstreaming.com/h/rockctech" method=get name=QuestionEntry>
<input type=hidden name=Portal value=rockctech>
<input type=hidden name=Target value=ds/queryPost>
<input type=hidden name=Template value=ds/onlineExperts.tmpl>
<input type=hidden name=JavaScript value=false>


<input type=hidden name=Form value=pbQuestionEntry>
<input type=hidden name=Question value="Start Session">
<input type=hidden name=Audience value="ie">
<table cellpadding=0 cellspacing=0 border=0 width=420 background="http://broker.desktopstreaming.com/partners/images/smartbox_bg.gif">
<tr>
<td align=center>
<table cellpadding=0 cellspacing=0 border=0 width=356 background="http://broker.desktopstreaming.com/partners/images/1x1.gif">

<tr>
<td height=30></td>
</tr>
<tr>
<td colspan=9><img src="http://broker.desktopstreaming.com/partners/images/ds_pb_a_top_shadow.gif" width=356 height=7></td>
</tr>
<tr>
<td bgcolor=#aaaaaa><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#c5c5c5><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#dadada><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#e9e9e9><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#f3f3f3><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=114></td>
<td bgcolor=#ffffff align=center valign=top>
<table cellpadding=0 cellspacing=0 border=0 width=337>
<tr>
<td height=4></td>
</tr>
<tr>
<td height=4></td>
</tr>
</table>
<table cellpadding=0 cellspacing=0 border=0 width=337>
<script language="JavaScript">
<!--
document.write('<tr>');
document.write('<td colspan=2><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=3><br>');

document.write('<font face=verdana,arial,helvetica size=2><b><i>Choose your agent and click the button to proceed.</i></b></font><br>');
document.write('<img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=10><br></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td valign=middle><font face=verdana,arial,helvetica size=1>');
document.write('<select name="ExpertKeys" style="font: normal 9 verdana,arial,helvetica;width:200;height20;">');

addOnlineReps(); // this will add some more options
document.write('</select></font></td>');
document.write('<td valign=middle><input type=image name="Click Here" value=submit onClick=setJS() src="http://broker.desktopstreaming.com/partners/images/ds_pb_smartbox_button_white.gif" width=60 height=61 border=0></td>');
document.write('</tr>');
//-->
</script>
<noscript>
<tr>
<td align=middle><img src="broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=3><br>
<font face=verdana,arial,helvetica size=2><b><i>Click button below to start a demo.</i></b></font><br>
<img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=10></td>
</tr>
<tr>
<td align=middle><input type=image name="Click Here" value=submit onClick=setJS() src="http://broker.desktopstreaming.com/partners/images/ds_pb_smartbox_button_white.gif" width=60 height=61 border=0></td>
</tr></noscript>
<tr>
<td height=8></td>
</tr>
</table>
</td>
<td bgcolor=#f3f3f3><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#e9e9e9><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#dadada><img src="http://broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=1></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="http://broker.desktopstreaming.com/partners/images/g2a_pb_smartbox_tag.gif" width=180 height=29 alt="Powered by GoToAssist"></td>
</tr>
</table>
</form>

Now it needs to be about 190 pixels in width.  Somewhere..  The dropdown box might need to be above the click here button but I am not certain how to do that & I am afraid of messing up the code.  

Thanks!

-Corey
0
Comment
Question by:coreybryant
  • 4
  • 4
8 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 2000 total points
ID: 12405098
How about this:

<html>
<head>
<base href="http://broker.desktopstreaming.com/">
<script language="JavaScript">
<!--
function setJS() {
document.QuestionEntry.JavaScript.value = "true";
document.QuestionEntry.Target.value = "he/queryPost";
}
// Just in case the JS from the broker can't be loaded
function addOnlineReps() {
document.write('<option value="-1" selected>First available');
}
//-->
</script>
<script language="JavaScript"

src="http://broker.gotoassist.com/servlet/com.ec.expertbroker.servlets.OnlineExpertsServlet?

Portal=rockctech"></script>
</head>
<body>
<table><tr>
<td colspan=3 align=center>
<form action="h/rockctech" method=get name=QuestionEntry>
<input type=hidden name=Portal value=rockctech>
<input type=hidden name=Target value=ds/queryPost>
<input type=hidden name=Template value=ds/onlineExperts.tmpl>
<input type=hidden name=JavaScript value=false>


<input type=hidden name=Form value=pbQuestionEntry>
<input type=hidden name=Question value="Start Session">
<input type=hidden name=Audience value="ie">
<table cellpadding=0 cellspacing=0 border=0 width=420 background="partners/images/smartbox_bg.gif">
<tr>
<td align=center>
<table cellpadding=0 cellspacing=0 border=0 width=356 background="partners/images/1x1.gif">

<tr>
<td height=30></td>
</tr>
<tr>
<td colspan=9><img src="partners/images/ds_pb_a_top_shadow.gif" width=356 height=7></td>
</tr>
<tr>
<td bgcolor=#aaaaaa><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#c5c5c5><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#dadada><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#e9e9e9><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#f3f3f3><img src="partners/images/1x1.gif" width=1 height=114></td>
<td bgcolor=#ffffff align=center valign=top>
<table cellpadding=0 cellspacing=0 border=0 width=337>
<tr>
<td height=4></td>
</tr>
<tr>
<td height=4></td>
</tr>
</table>
<table cellpadding=0 cellspacing=0 border=0 width=337>
<script language="JavaScript">
<!--
document.write('<tr>');
document.write('<td colspan=2><img src="partners/images/1x1.gif" width=1 height=3><br>');

document.write('<font face=verdana,arial,helvetica size=2><b><i>Choose your agent and click the button to

proceed.</i></b></font><br>');
document.write('<img src="partners/images/1x1.gif" width=1 height=10><br></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td valign=middle><center><font face=verdana,arial,helvetica size=1>');
document.write('<select name="ExpertKeys" style="font: normal 9 verdana,arial,helvetica;width:200;height20;">');

addOnlineReps(); // this will add some more options
document.write('</select></font><br>');
document.write('<input type=image name="Click Here" value=submit onClick=setJS()

src="partners/images/ds_pb_smartbox_button_white.gif" width=60 height=61 border=0></center></td>');
document.write('</tr>');
//-->
</script>
<noscript>
<tr>
<td align=middle><img src="broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=3><br>
<font face=verdana,arial,helvetica size=2><b><i>Click button below to start a demo.</i></b></font><br>
<img src="partners/images/1x1.gif" width=1 height=10></td>
</tr>
<tr>
<td align=middle><input type=image name="Click Here" value=submit onClick=setJS()

src="partners/images/ds_pb_smartbox_button_white.gif" width=60 height=61 border=0></td>
</tr></noscript>
<tr>
<td height=8></td>
</tr>
</table>
</td>
<td bgcolor=#f3f3f3><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#e9e9e9><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#dadada><img src="partners/images/1x1.gif" width=1 height=1></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="partners/images/g2a_pb_smartbox_tag.gif" width=180 height=29 alt="Powered by GoToAssist"></td>
</tr>
</table>
</form>


0
 
LVL 29

Author Comment

by:coreybryant
ID: 12405156
The still seems to stretch the cell out more than 190 pixels in width..  And I get a JS error as well

-Corey
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12405403
The table with is controled by the the width attibute where you multiple times use 337 pixel and also by the width of the gifs.
I do not get any script errors.
Is your page visible online?

<html>
<head>
<base href="http://broker.desktopstreaming.com/">
<script language="JavaScript">
<!--
function setJS() {
document.QuestionEntry.JavaScript.value = "true";
document.QuestionEntry.Target.value = "he/queryPost";
}
// Just in case the JS from the broker can't be loaded
function addOnlineReps() {
document.write('<option value="-1" selected>First available');
}
//-->
</script>
<script language="JavaScript"

src="http://broker.gotoassist.com/servlet/com.ec.expertbroker.servlets.OnlineExpertsServlet?

Portal=rockctech"></script>
</head>
<body>
<table><tr>
<td colspan=3 align=center>
<form action="h/rockctech" method=get name=QuestionEntry>
<input type=hidden name=Portal value=rockctech>
<input type=hidden name=Target value=ds/queryPost>
<input type=hidden name=Template value=ds/onlineExperts.tmpl>
<input type=hidden name=JavaScript value=false>


<input type=hidden name=Form value=pbQuestionEntry>
<input type=hidden name=Question value="Start Session">
<input type=hidden name=Audience value="ie">
<table cellpadding=0 cellspacing=0 border=0 width=420 background="partners/images/smartbox_bg.gif">
<tr>
<td align=center>
<table cellpadding=0 cellspacing=0 border=0 width=190 background="partners/images/1x1.gif">

<tr>
<td height=30></td>
</tr>
<tr>
<td colspan=9><img src="partners/images/ds_pb_a_top_shadow.gif" width=190 height=7></td>
</tr>
<tr>
<td bgcolor=#aaaaaa><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#c5c5c5><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#dadada><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#e9e9e9><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#f3f3f3><img src="partners/images/1x1.gif" width=1 height=114></td>
<td bgcolor=#ffffff align=center valign=top>
<table cellpadding=0 cellspacing=0 border=0 width=190>
<tr>
<td height=4></td>
</tr>
<tr>
<td height=4></td>
</tr>
</table>
<table cellpadding=0 cellspacing=0 border=0 width=90>
<script language="JavaScript">
<!--
document.write('<tr>');
document.write('<td colspan=2 ><img src="partners/images/1x1.gif" width=1 height=3><br>');

document.write('<font face=verdana,arial,helvetica size=2><b><i>Choose your agent and click the button to

proceed.</i></b></font><br>');
document.write('<img src="partners/images/1x1.gif" width=1 height=10><br></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td valign=middle><center><font face=verdana,arial,helvetica size=1>');
document.write('<select name="ExpertKeys" style="font: normal 9 verdana,arial,helvetica;width:200;height20;">');

addOnlineReps(); // this will add some more options
document.write('</select></font><br>');
document.write('<input type=image name="Click Here" value=submit onClick=setJS()

src="partners/images/ds_pb_smartbox_button_white.gif" width=60 height=61 border=0></center></td>');
document.write('</tr>');
//-->
</script>
<noscript>
<tr>
<td align=middle><img src="broker.desktopstreaming.com/partners/images/1x1.gif" width=1 height=3><br>
<font face=verdana,arial,helvetica size=2><b><i>Click button below to start a demo.</i></b></font><br>
<img src="partners/images/1x1.gif" width=1 height=10></td>
</tr>
<tr>
<td align=middle><input type=image name="Click Here" value=submit onClick=setJS()

src="partners/images/ds_pb_smartbox_button_white.gif" width=60 height=61 border=0></td>
</tr></noscript>
<tr>
<td height=8></td>
</tr>
</table>
</td>
<td bgcolor=#f3f3f3><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#e9e9e9><img src="partners/images/1x1.gif" width=1 height=1></td>
<td bgcolor=#dadada><img src="partners/images/1x1.gif" width=1 height=1></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="partners/images/g2a_pb_smartbox_tag.gif" width=180 height=29 alt="Powered by GoToAssist"></td>

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 29

Author Comment

by:coreybryant
ID: 12405560
Here it is: http://www.rockctech.com/rct1/default_copy(4).asp - what confuses me more is you have some of the script in the <HEAD>, I put it in the body because that is where the gotoassist people had it

-Corey
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12405658
This line has an error because the line is broken by newlines:


document.write('<font face=verdana,arial,helvetica size=2><b><i>Choose your agent and click the button to

proceed.</i></b></font><br>');

0
 
LVL 29

Author Comment

by:coreybryant
ID: 12405802
Fixed those two problems: http://www.rockctech.com/rct1/default_copy(4).asp - it seems to be working locally - as far as the width, but not on the server

-Corey
0
 
LVL 29

Author Comment

by:coreybryant
ID: 12405873
Never mind.  one of the includes was moved

-Corey
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12407874
Thanks for points.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

599 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