Drop Down and textBox

G

Go Live

HI,

I am trying to include textbox and dropdown in a single cell. The
things goes like this there is one radio button for textbox and one
radio button for dropdown. Now when the user click one radio button
texbox should appear in a <td> cell and when other radio button is
clicked dropdown should appear in the same cell<td> by removing the
textbox and viceversa.

The code goes like this:
<table ID="Table">
<tr>
<td></td>
<td><input type="radio" </td>
<td><label>Radio button for text Box</label></td>
<td width="10"></td>
<td><input type="radio" </td>
<td><label>Radio Button for Drop Down</label></td>
<td></td>
</tr>
<tr>
<td><label>Choose</label></td>
<td>
<input type="text" ID="txtKeyword"
NAME="txtKeyword">
</td>
</td>
<select name="dropdown" style="font-size:10px;">
<option value="1">AAAA</option>
<option value="2">BBBB</option>
<option value="3">CCCC</option>

</select>

</td>

</tr>
<tr>

<td><img src="Search"></td>
</tr>
</table>

Any suggestions or good examples will be very much appreciated.

Thanks
 
J

John Hosking

Go said:
I am trying to include textbox and dropdown in a single cell.

One wonders why.
The
things goes like this there is one radio button for textbox and one
radio button for dropdown. Now when the user click one radio button
texbox should appear in a <td> cell and when other radio button is
clicked dropdown should appear in the same cell<td> by removing the
textbox and viceversa.

The code goes like this:

I have snipped your code for the following reasons:
1) You should have posted a URL to your page (preferably a simplified
test page, validated) as is customary here, instead of posting code.
2) This code is poorly formatted for usenet. Why do we need a nine-TAB
indent? This is hard to read.
3) This code is invalid. Visit http://validator.w3.org/
4) This code doesn't seem to be an attempt to place a textbox and
dropdown in a single cell. It looks like you want them in *different*
cells. But you've got an extra </td> which probably ought to be a <td>
and with messed-up code like this it's not easy to help you anyway.

You don't seem to have researched this much. Maybe if you have a read
through http://www.w3.org/TR/html4/interact/forms.html it'll help you.
 
G

Go Live

I am sorry for this. But if you get an idea of what i am trying to
tell here then please post some good examples. Please don't go with
the above HTML code its just a rough piece of code to give some idea
of what i am looking for.

Thank you very much.
 
A

Adrienne Boswell

Gazing into my crystal ball I observed Go Live <[email protected]>
writing in @l1g2000hsa.googlegroups.com:
I am sorry for this. But if you get an idea of what i am trying to
tell here then please post some good examples. Please don't go with
the above HTML code its just a rough piece of code to give some idea
of what i am looking for.

Thank you very much.

What are you replying to? Please understand that you are posting to a
Usenet group - not a message board. Some news servers may not have all
messages, so it is important to always quote to what you are referring,
trimming as necessary.
 
A

Andrew Bailey

Go Live said:
HI,

I am trying to include textbox and dropdown in a single cell. The
things goes like this there is one radio button for textbox and one
radio button for dropdown. Now when the user click one radio button
texbox should appear in a <td> cell and when other radio button is
clicked dropdown should appear in the same cell<td> by removing the
textbox and viceversa.

The code goes like this:
<table ID="Table">
<tr>
<td></td>
<td><input type="radio" </td>
<td><label>Radio button for text Box</label></td>
<td width="10"></td>
<td><input type="radio" </td>
<td><label>Radio Button for Drop Down</label></td>
<td></td>
</tr>
<tr>
<td><label>Choose</label></td>
<td>
<input type="text" ID="txtKeyword"
NAME="txtKeyword">
</td>
</td>
<select name="dropdown" style="font-size:10px;">
<option value="1">AAAA</option>
<option value="2">BBBB</option>
<option value="3">CCCC</option>

</select>

</td>

</tr>
<tr>

<td><img src="Search"></td>
</tr>
</table>

Any suggestions or good examples will be very much appreciated.

Thanks

Here's a rough example that should get you going...

<script>
function showtext(){
document.getElementById('text').style.display='inline';
document.getElementById('menu').style.display='none';
}
function showmenu(){
document.getElementById('menu').style.display='inline';
document.getElementById('text').style.display='none';
}
</script>



<table>
<tr>
<td>Check this box for TEXT INPUT</td>
<td><input type="radio" onclick="showtext()"></td>
<td rowspan="2">
<div id="text" style="display: inline">
<input type="text" ID="txtKeyword" NAME="txtKeyword">
</div>
<div id="menu" style="display: none">
<select name="dropdown" style="font-size:10px;">
<option value="1">AAAA</option>
<option value="2">BBBB</option>
<option value="3">CCCC</option>
</select>
</div>
</td>
</tr>
<td>Check this box for DROPDOWN MENU</td>
<td><input type="radio" onclick="showmenu()"></td>
</tr>
</table>

Hope this helps

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top