Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6247615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:54:34+00:00 2026-05-24T12:54:34+00:00

I wrote a short javascript to resize a popup window when an element is

  • 0

I wrote a short javascript to resize a popup window when an element is added to the page.
For some reason each time a new element is added the width of the window decreases by 4 pixels, even though it should stay the same because the width of added elements is always the same.

Any idea what could be causing this ?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <script type="text/javascript" src="scripts.js"></script>
    <script type="text/javascript">
        function resizeWin(){
            var winHeight=document.getElementById('bodyArea').offsetHeight;
            var winWidth=document.getElementById('bodyArea').offsetWidth;
            alert(winWidth);
            window.resizeTo(winWidth+20,winHeight+80);
        }

    </script>
</head>
<body onLoad="javascript:resizeWin()"> 
<div id="bodyArea" style="overflow: hidden;"> 
    <form id="courseDetails" action="/CourseRegistration/Courses" method="POST" width: 300px">
        <table>
                //blah blah, constant size
        </table>

        <input type="button" value="Add Session" onclick="addRow('addCourse');resizeWin();" />
        <input type="button" value="RemoveSession" onclick="deleteRow('addCourse');resizeWin();" />

        <table id="addCourse" border="1">
            <tr>
                <td><input type="checkbox" name="chk"/></td>
                <td>
                    <select name="day">
                        <option value="1">Sunday</option>
                        <option value="2">Monday</option>
                        <option value="3">Tuesday</option>
                        <option value="4">Wednesday</option>
                        <option value="5">Thursday</option>
                        <option value="6">Friday</option>
                        <option value="7">Saturday</option>
                    </select>
                </td>
                <td>
                    <select name="start">
                        <option value="1">1</option>
                        <option value="2">2</option>
                        <option value="3">3</option>
                        <option value="4">4</option>
                       <option value="5">5</option>
                <option value="6">6</option>
                        <option value="7">7</option>
                        <option value="8">8</option>
                        <option value="9">9</option>
                        <option value="10">10</option>
                    </select>
                </td>
                <td>
                    <select name="duration">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                </select>
            </td>
        </tr>
    </table>
    <input type="submit" value="Submit" name="addCourse" />
    </form>
    </div>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:54:34+00:00Added an answer on May 24, 2026 at 12:54 pm

    On the

    <form id="courseDetails" action="/CourseRegistration/Courses" method="POST" width: 300px">

    You’re missing the openning =” of the width; try width="300px" maybe thats making some bug.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote some JavaScript to allow editing a list of items within an HTML
I wrote a tab system using some very basic Javascript and it runs like
I wrote a short bash script to complete a task that involves creating a
I wrote a short bit of code to simply skip num_lines lines in an
So I wrote this short script (correct word?) to download the comic images from
To help me better understand lambda I wrote this short snippet that rotates and
I wrote some sort of console client for a simple application. To be more
Just curious about jQuery/Javascript and referring to options within variables. So, I wrote a
This is a weird one. Long story short: wrote a usercontrol using AJAX. Used
Is there a short way to write the following using either JavaScript or jQuery?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.