karthikeyam
January 30th, 2006, 05:19 AM
i added items into listbox using java script like this
function add1()
{
if(form1.text1.value=="")
alert("Name should not be Blank");
else
form1.select1.options[form1.select1.length] = new Option(form1.text1.value);
}
now i want to modify the newly enterd items
but as this is not database i cannot
how to do that
i can delete\modify existing items but cannot which r added dynamically
first i added into listbox like this
<SELECT id="select1" style="Z-INDEX: 101; LEFT: 104px; WIDTH: 160px; POSITION: absolute; TOP: 152px; HEIGHT: 192px"
size="12" name="select1">
<OPTION id="Hyderabad" value="Hyderabad">Hyderabad</OPTION>
<option id="Bangalore" value="Bangalore">Bangalore</option>
<option id="Delhi" value="Delhi">Delhi</option>
<option id="Madras" value="Madras">Madras</option>
<option id="Bombay" value="Bombay">Bombay</option>
<option id="Calcutta" value="Calcutta">Calcutta</option>
<option id="patna" value="patna">patna</option>
</SELECT>
i can change this but not which r entered next
why?
please tell the code
function add1()
{
if(form1.text1.value=="")
alert("Name should not be Blank");
else
form1.select1.options[form1.select1.length] = new Option(form1.text1.value);
}
now i want to modify the newly enterd items
but as this is not database i cannot
how to do that
i can delete\modify existing items but cannot which r added dynamically
first i added into listbox like this
<SELECT id="select1" style="Z-INDEX: 101; LEFT: 104px; WIDTH: 160px; POSITION: absolute; TOP: 152px; HEIGHT: 192px"
size="12" name="select1">
<OPTION id="Hyderabad" value="Hyderabad">Hyderabad</OPTION>
<option id="Bangalore" value="Bangalore">Bangalore</option>
<option id="Delhi" value="Delhi">Delhi</option>
<option id="Madras" value="Madras">Madras</option>
<option id="Bombay" value="Bombay">Bombay</option>
<option id="Calcutta" value="Calcutta">Calcutta</option>
<option id="patna" value="patna">patna</option>
</SELECT>
i can change this but not which r entered next
why?
please tell the code