I have a drop down box which has two values, when either is chose a seperate text box or another drop down box is opened. However it part works with the second option but not the first one. can someone have a look:

php/html code:

                Choose Delivery Type </td>
               <td> <select name = 'elementtype1'id='elementtype1'           
                        <option value='Select'>Select</option>
                        <option value='forwardorder'>Forward Order</option>
                        <option value='byreturn'>By Return</option>

                        <div id='div1'>Enter By Return Date<input type='text''name='whatever1' />

                        <div id='div2'>  
                        <td><select name='deliveryDate'>"; 
                        $listCapacityDates = $cid->ListCapacity();
                        foreach($listCapacityDates as $x) {
                        $content .= "<option value='".$x['month']."'>".$x['month']."</option>";

                        $content .= "</div>

Ajax Code:

                         function showfield(name){
                         else document.getElementById('div1').style.display="none";

                          else document.getElementById('div2').style.display="none";


Recommended Answers

All 5 Replies

Here is a Sample similar to what you are trying to achieve. Just view the source code of the page and it is pretty much self explanatory. I am experimenting with the jquery chained link plugin. Please do not hotlink the jquery files. That's all we are asking. please play by the rule..

the link you gave does not work. the server is blocking access to those directories.

Works for me...

thats so bizzzare. I'm connect via a proxy server i dont know whether that affects things.

it was because i was going through a proxy server. I got your script. thanks for that. i will try get my head around it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.