The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
using JavaScript with PHP to create a dynamic form.
I want to have an option (yes/no) drop down box, that when set to "no", hides two of the input fields on the form.
the input code is echoed by PHP though, and contains an if /else statement. the code that needs to be hidden is: PHP Code:
I could hide it with a variable, but then they would have to click submit first, right? or is there another way? It needs to diapear (or reapear) as soon as the user chooses the first option. any ideas? thanks, Nick |
#2
|
|||
|
|||
Here's what I'm trying:
PHP Code:
PHP Code:
and the Div tag where the new field should apear: PHP Code:
There's no Parse Errors, but the Javascript has no effect. |
#3
|
||||
|
||||
you mean javascript?
|
#4
|
|||
|
|||
yes.
|
#5
|
|||
|
|||
I don't know Js but i think its something like this.
You just see what the value is document.formname.value=no then you dont show the fields and else you do. I said i dont know JS i dont know the syntax but it's not that hard, look it up on google under something like: javascript forms |
#6
|
|||
|
|||
Getting the JavaScript to work in a regular HTML document isn't the problem... I have that working. What I'm trying to do is integrate the JavaScript with my PHP code so that they work together.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|