www.webdeveloper.com
Results 1 to 6 of 6

Thread: Misplaced Buttons

  1. #1
    Join Date
    Sep 2008
    Location
    Jackson MS
    Posts
    374

    Misplaced Buttons

    I am trying to work on a simple page to convert from degrees, degrees & minutes, or degree-minute-second to each other. There should be a button on the end of each line to convert the info on that line to the other two forms, but the buttons seem to all be at the end of the previous line instead of where they should be.

    What am I doing wrong? TIA
    Code:
    <form name="degree" onsubmit="return false;">
     <table>
      <tr>
       <td>Degrees Only</td><td><input name="dod" ></td><td colspan="4"></td><td><input type="button" value="Click" onclick="doDeg()"></td></tr>
      <tr>
       <td>Degrees Minutes</td><td><input name="dmd" > </td><td><input name="dmm" >'</td><td colspan="2"></td><td><input type="button" value="Click" onclick="doMin()"></td></tr>
      <tr>
        <td>Deg. Min., &amp; Sec</td><td><input name="dsd" > </td><td><input name="dsm" >' </td><td><input name="dss" >"</td>
          <input type="button" value="Click" onclick="doSec()">
        </tr></table></form>

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,438

    Lightbulb

    If you put a temporary border into the table, it becomes pretty easy to spot the problem.

    You did not have <TD> tags around the last button.

    Code:
    <form name="degree" onsubmit="return false;">
     <table border="1">
      <tr>
       <td>Degrees Only</td>
       <td><input name="dod" ></td>
       <td colspan="2"></td>
       <td><input type="button" value="Click 1" onclick="doDeg()"></td>
      </tr>
      <tr>
       <td>Degrees Minutes</td>
       <td><input name="dmd" ></td>
       <td><input name="dmm" >'</td>
       <td colspan="1"></td>
       <td><input type="button" value="Click 2" onclick="doMin()"></td>
      </tr>
      <tr>
       <td>Deg. Min., &amp; Sec</td>
       <td><input name="dsd" > </td>
       <td><input name="dsm" >' </td>
       <td><input name="dss" >"</td>
       <td><input type="button" value="Click 3" onclick="doSec()"></td>
      </tr>
     </table>
    </form>
    Good Luck!

  3. #3
    Join Date
    Sep 2008
    Location
    Jackson MS
    Posts
    374

    resolved

    Many thanks! I thought it would be something simple like that, just had a blind spot.

  4. #4
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,438
    You're most welcome.
    Happy to help.
    Good Luck!

  5. #5
    Join Date
    Sep 2008
    Location
    Jackson MS
    Posts
    374
    The finished product is at the bottom of this page.htm.

  6. #6
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,438
    Assuming your calculations are done in 'DoDeg', 'DoMin' and 'DoSec' (not provided in post),
    if the output is to be in decimal format and you want to limit it to 4 significant places
    use a X.toFixed(4) command where 'X' is the calculated value to limit.

    I don't know enough about GPS to know if this is significant or not,
    just information to consider from reading your referenced page and
    clicking on the JS calculator. Change only to avoid extra display digits.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles