| | |
DHTML <--->selectlist
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2005
Posts: 14
Reputation:
Solved Threads: 0
Hi everyone,
Last time i posted an question but still there is no response.
ok no problem but this time i came with solution but with small difficulties.
could you please help atleast in this difficulties.
i have created the page with button and on clicking the button it produces 3 text field and with a selection list.
"now my problem is to get the selected item and change the text accordingly"
here is my code.
<html>
<head>
<script type="text/javascript">
function appendtable() {
var div = document.getElementById("divide");
var ControlsDesign = document.createElement("div");
var table_cd = document.createElement("table ");
var tr_cd = document.createElement("tr");
var td_cd = document.createElement("td");
var table_content = document.createElement("table");
var tr = document.createElement("tr");
var td = document.createElement("td");
var oSelect=document.createElement("select");
var oOption = document.createElement("OPTION");
oOption.text="Ferrari";
oOption.value="4";
oSelect.add(oOption);
var oOption1 = document.createElement("OPTION");
oOption1.text="Fessari";
oOption1.value="4";
oSelect.add(oOption1);
var txt1=document.createElement("input type=text");
txt1.value="mamu"
var txt2=document.createElement("input type=text");
txt2.value="Machan"
var txt3=document.createElement("input type=text");
txt3.value="maplai"
td.appendChild(oSelect);
td.appendChild(txt1);
td.appendChild(txt2);
td.appendChild(txt3);
tr.appendChild(td);
table_content.appendChild(tr);
td_cd.appendChild(table_content);
tr_cd.appendChild(td_cd);
table_cd.appendChild(tr_cd);
ControlsDesign.appendChild(table_cd);
div.appendChild(ControlsDesign);
document.getElementById("divide").innerHTML = document.getElementById("divide").innerHTML;
}
</script>
</head>
<body>
<input type="button" onclick="appendtable()" value="Press me">
<div id="divide" height="100"></div>
</body>
</html>
please give reply to my post i m just a kid in web developing.
Nandoo
Last time i posted an question but still there is no response.
ok no problem but this time i came with solution but with small difficulties.
could you please help atleast in this difficulties.
i have created the page with button and on clicking the button it produces 3 text field and with a selection list.
"now my problem is to get the selected item and change the text accordingly"
here is my code.
<html>
<head>
<script type="text/javascript">
function appendtable() {
var div = document.getElementById("divide");
var ControlsDesign = document.createElement("div");
var table_cd = document.createElement("table ");
var tr_cd = document.createElement("tr");
var td_cd = document.createElement("td");
var table_content = document.createElement("table");
var tr = document.createElement("tr");
var td = document.createElement("td");
var oSelect=document.createElement("select");
var oOption = document.createElement("OPTION");
oOption.text="Ferrari";
oOption.value="4";
oSelect.add(oOption);
var oOption1 = document.createElement("OPTION");
oOption1.text="Fessari";
oOption1.value="4";
oSelect.add(oOption1);
var txt1=document.createElement("input type=text");
txt1.value="mamu"
var txt2=document.createElement("input type=text");
txt2.value="Machan"
var txt3=document.createElement("input type=text");
txt3.value="maplai"
td.appendChild(oSelect);
td.appendChild(txt1);
td.appendChild(txt2);
td.appendChild(txt3);
tr.appendChild(td);
table_content.appendChild(tr);
td_cd.appendChild(table_content);
tr_cd.appendChild(td_cd);
table_cd.appendChild(tr_cd);
ControlsDesign.appendChild(table_cd);
div.appendChild(ControlsDesign);
document.getElementById("divide").innerHTML = document.getElementById("divide").innerHTML;
}
</script>
</head>
<body>
<input type="button" onclick="appendtable()" value="Press me">
<div id="divide" height="100"></div>
</body>
</html>
please give reply to my post i m just a kid in web developing.
Nandoo
Last edited by nandoo; Apr 29th, 2005 at 6:26 am. Reason: error
![]() |
Similar Threads
- Flash within DHTML (JavaScript / DHTML / AJAX)
- dhtml coding placement for existing nav bars (JavaScript / DHTML / AJAX)
- dhtml menu and flash (JavaScript / DHTML / AJAX)
- Dhtml (Visual Basic 4 / 5 / 6)
- Problems creating a DHTML menu script with a stylish dropdown menu (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: form validation not working
- Next Thread: body.onload += "XX"
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate array automatically beta box browser bug calendar captchaformproblem cart close codes column css cursor date debugger decimal dependent design disablefirebug dom download dropdown element embed engine enter error events ext file firefox focus form frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 iframe index java javascript javascripthelp2020 jawascriptruntimeerror jquery jsp libcurl listbox maps masterpage media menu microsoft mimic mp4 onmouseoutdivproblem onmouseover paypal pdf php player position post problem programming progressbar prototype redirect regex safari scale scriptlets scroll search security select software sql text textarea unicode w3c website window windowofwords windowsxp





