php_b34st Posted August 10, 2008 Share Posted August 10, 2008 Hi, I have never written in javascript before however I think I need it now. I want to make a script which will enable me to dispkay a different form depending on which checkbox is checked without submitting the form. example: Say i have checkbox A and B when checkbox A is checked I want to display text field A and a dropdown menu, if checkbox b is checked i want to display text field B and Text field C I think this will only be possible using javascript but as I said at the start I havent done any javascript in the past and wouldnt know where to start. Can anybody give any pointers as to where to begin, what to look for, what kind of functions i will need for this script. That is if this is even possible with javascript? thanks in advance Link to comment https://forums.phpfreaks.com/topic/119046-javascript-forms/ Share on other sites More sharing options...
Acs Posted August 10, 2008 Share Posted August 10, 2008 You have to use js and css. Keep the forms in divs and then change the display to block to be seen and to none to hide it. Put this on the onclick event of the checkbox. Also you must check if the user is checking or unchecking the checkbox Link to comment https://forums.phpfreaks.com/topic/119046-javascript-forms/#findComment-613033 Share on other sites More sharing options...
php_b34st Posted August 10, 2008 Author Share Posted August 10, 2008 Is there any sites/tutorials showing mr how to do the functions you mentioned? Link to comment https://forums.phpfreaks.com/topic/119046-javascript-forms/#findComment-613040 Share on other sites More sharing options...
Acs Posted August 10, 2008 Share Posted August 10, 2008 They are just basic javascript function. Nothing special, but google for "javascript changing css" or something like that and also "javascript events" Link to comment https://forums.phpfreaks.com/topic/119046-javascript-forms/#findComment-613043 Share on other sites More sharing options...
php_b34st Posted August 10, 2008 Author Share Posted August 10, 2008 thanks for the tips i will take a look Link to comment https://forums.phpfreaks.com/topic/119046-javascript-forms/#findComment-613044 Share on other sites More sharing options...
Acs Posted August 10, 2008 Share Posted August 10, 2008 No prob Link to comment https://forums.phpfreaks.com/topic/119046-javascript-forms/#findComment-613045 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.