Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jul 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript/HTML problem!!!

    When I disable my webpage the text in my edit fields duplicates. e.g. ABC changes to ABCABC. THis only seems to happen when I have my edit fields in a <table>. A sample of my code is provided. I'd appreicate any help. Thanks, B.

    <html>
    <head>
    <title>Test</title>

    <script type="text/javascript">
    <!--
    function disableForm(form)
    {
    alert('disable form');
    form.disabled=true;
    }


    // -->
    </script>


    </head>

    <body>
    <form name="formname">

    <table>

    <tbody>
    <tr>
    <td>

    <input type=edit name="textinput" value="abc"/>
    </td>
    </tr>
    <tr>
    <td align=left>input</td>
    <TD align=left><input type=edit name=userName>* </TD>
    </tr>

    </tbody>

    </table>
    <input type="button" value="test" onclick="java script:disableForm(this.form);" />
    </form>
    </body>
    </html>
    Last edited by bboyle; 07-08-2003 at 02:56 PM.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    It's alittle bit confusing for me... What do you want to do with this script? Which is the final ideea?

    - see that there is a small mistake, but not essential, name="userName"
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Jul 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, I put up the wrong code! I have sionce changed it. This is only a very rough example that I put together. Basically I want to disable the form (i.e. button and textfields). My problem is that when my textfields are embedded in a table and then the page is disabeled, the text in the fields duplicates. I want to stop this happening and just the page to be disabled and the text in the fields to be displayed normally, not duplicated.
    Thanks for your response.

  • #4
    Regular Coder
    Join Date
    Mar 2003
    Posts
    241
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've tested your code, and I think this is some kind of bug in IE.
    What browser have you tested in and what version ?
    I'm on IE 6.0


    The text in the ABC-textbox is actually not duplicated, it only look that way. Try selecting the second ABC, you can't! You can only select the first ABC.

    That seemed odd to me so I figured it's a bug, I then switched application and then switched back to IE, and there's nothing visible in that box! But if I'd select the content in it (which could not be seen, but I tried anyway) it's visible, but if you deselect it's invisible again. And there's only one ABC-value in there too, but invisible...

    This has to be a bug of some kind, maybe some others can test with their browser and/or other browsers too ??


    I also cleaned up your HTML a bit and tried, no differance.

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    wouldn't suits to you simply to switch visible/hidden the textfield and the button? Use some functions to change CSS style than.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think the problem may be that there is no standard for disabling form objects. Disabled is supposed be a element level property, not a form level property. MS seems to have (incorrectly) extended this property to the form object and then botched the implementation.

    Other browsers like Mozilla don't recognize disabled as a property for a form.
    Check out the Forum Search. It's the short path to getting great results from this forum.


  •  

    Posting Permissions

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