Jump to content


Photo

Javascript with PHP


  • Please log in to reply
2 replies to this topic

#1 vidyashankara

vidyashankara
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 20 July 2006 - 03:25 PM

I have this function on my php script..
echo "
function add() {
var i =1;
var txt = \"SEGID : <select name='segid[]'>";
for ($i=0; $i<count($atm); $i++) {
echo "<option value='PRO$atm[$i]'>PRO$atm[$i]";
}
echo "</select>\";
txt +=\" Residue : <select name='resi[]'> <option value=ASP>ASP <option value=GLU>GLU <option value=LYS>LYS </select>\";
txt +=\" Residue ID : <input type='text' name='resid[]' + i><br>\";
document.getElementById('prot').innerHTML += txt;
}";

This function adds a set of text boxes everytime you click a button. The problem is, when you click on the button the second time, the values in the first set of text boxes gets reset and i gotta enter them again. is there anyway to prevent that?


#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 20 July 2006 - 03:31 PM

There is a seperate forum for client side issues, I suggest you post this there.

#3 vidyashankara

vidyashankara
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 20 July 2006 - 03:39 PM

Thanks! Will do :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users