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

Java Script...I think

  • 14-03-2008 10:42am
    #1
    Closed Accounts Posts: 41


    Ok.... well im in college working on a project using asp vbscript. i need to have a dynamic form that starts with like four textfields and 2 radio buttons and once one of the radio buttons has been checked, I need either 2 more textfields or if the other one is checked three more textfields to appear on screen. each of the textfields need to have different labels too. :eek:

    so i was fishing around for answers and trying myself to write some sort of code using asp, and trying a a lil bit of java script but it hasnt worked out well so far. All i need is a push in the right direction then ill be flying so if theres anyone that can help that would be great.


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    You really need to post some code if you want an answer, have a read of this and follow those guidelines everywhere you're asking a question online.


  • Closed Accounts Posts: 41 greentoymonkey


    <script language="JavaScript">
    <!--
    if (RadioGroup1, checked = 0)
    {
    
     Test
                <input type="text" name="textfield" />
    }
    //-->
    </script>
    

    this is my attempt at the javascript but its giving me an error on the webpage of a syntax error


  • Closed Accounts Posts: 4,655 ✭✭✭Ph3n0m


    Hmmm I need to make dynamic form fields - think I'll try google

    http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=dynamic+form+fields

    quel suprise!


  • Registered Users, Registered Users 2 Posts: 6,334 ✭✭✭OfflerCrocGod


    <script language="JavaScript">
    <!--
    if (RadioGroup1, checked = 0)
    {
    
     Test
                <input type="text" name="textfield" />
    }
    //-->
    </script>
    

    this is my attempt at the javascript but its giving me an error on the webpage of a syntax error
    That's because it's totally wrong. What you must do is have the elements in the web page but hide them with CSS display: none then using onclick() you call a function that brings the hidden objects to view by changing their style values.

    If you want to do web development I highly recommend using Firebug and watching the Yahoo video on using it by Joe Hewitt. It's an invaluable tool for this kind of development.


  • Closed Accounts Posts: 41 greentoymonkey


    some great tips there lads thanks...really appreciate it


  • Advertisement
Advertisement