Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Fancy Form

  • 04-07-2002 10:48am
    #1
    Registered Users, Registered Users 2 Posts: 771 ✭✭✭


    Ive got an ASP page with a form for registration.

    i want to implement a feature such that if a user clicks yes to one checkbox... then another form input type(say a dropdown box) is hidden, or greyed out?

    anyone done anything like this before, or able to point me in the right direction...?

    help!!! pretty please!!!


Comments

  • Registered Users, Registered Users 2 Posts: 19,396 ✭✭✭✭Karoma


    google.com


  • Registered Users, Registered Users 2 Posts: 19,396 ✭✭✭✭Karoma


    rough idea from something that i have lying around. try working things out first in future :mad: it won't hurt half as much as you might think.

    <script language='javascript'>

    document.myform.send.disabled = true;
    document.onkeyup = proces;
    document.onmouseup = proces;
    document.onmousedown = proces;

    function proces()
    {
    if (document.myform.name.value == '')
    {document.myform.send.disabled = true;}
    else
    {document.myform.send.disabled = false;}
    }
    </script>

    probably doesn't work properly,etc. mneh!


    ... and the HTML ::

    <html>
    <body>
    <form name=myform>
    <input type=text name=name onchange='doIt()'>
    <input type=button value="Send (test)" name=send onclick='javascript:alert("This is only a test! Dimwittedmutha!")'>
    </body>
    </html>


  • Registered Users, Registered Users 2 Posts: 771 ✭✭✭whiteshadow


    eh.. thanks but..that's just a javascript popup msg to make sure that all form fields are filled..


  • Registered Users, Registered Users 2 Posts: 14 bar


    something like this?

    will need to be tweaked for netscape, but this should get you started


    <html>
    <head>
    <title>Nothing</title>
    <script language="javascript">

    function hidetextbox()
    {
    var cb = document.all.checkboxone;
    var tb = document.all.textboxone;
    if (cb.checked)
    {
    tb.disabled = true;
    tb.style.background = "#dddddd";
    }
    else
    {
    tb.disabled = false;
    tb.style.background = "#ffffff";
    }
    }

    </script>
    </head>

    <body bgcolor="#FFFFFF">
    <form method="get" action="whatever">
    <p>Check Box : <input type="checkbox" name="checkboxone" value="checkbox" onclick="hidetextbox()"></p>
    <p> Text Box : <input type="text" name="textboxone"></p>
    </form>
    </body>
    </html>



    bar


Advertisement