Jump to content

js event?


abs0lut

Recommended Posts

Uhm can you elaborate that?

 

what do you mean with "yes in the dropdown"? do you mean a confirmbox maybe?

 

What do you mean with "it will show an input field" do you mean you want a input field  to be shown inside the form without submitting it?

Link to comment
https://forums.phpfreaks.com/topic/119961-js-event/#findComment-618388
Share on other sites

I'll give you a start

 

<script>
function showInput(){
  //this is where you should build the input or make it visible
}
</script>
<select onchange="showInput()">
  <option>yes</option>
  <option>no</option>
</select>

 

you will still need to write the function but thats part of the fun

Link to comment
https://forums.phpfreaks.com/topic/119961-js-event/#findComment-618489
Share on other sites

yaya....

a more details of Dj:

<script language="JavaScript" type="text/javascript">
function showInput(value) {
    if(value == "yes") {
        var new_input = document.createElement("input");
        new_input.type = "text";
        new_input.name = "txt[]";

        document.getElementById("input-container").appendChild(new_input);
    }
}
</script>

<select onchange="showInput(this.options[this.selectedIndex].value)">
    <option value="yes">Yes</option>
    <option value="no">No</option>
</select>

<div id="input-container">
<!-- This is where your input box held -->
</div>

Link to comment
https://forums.phpfreaks.com/topic/119961-js-event/#findComment-618529
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.