You cant set event handlers as attributes when you are generating a table using DOM methods.
There are attachEvent method in IE and addEventListener method supported by other browsers.
But in your case - as much as i understand it - the old-fashion object.event=function works fine.
// so...
You have to call removeElement with string argument. Right now the code generated by newdiv.innerHTML looks like onclick='removeElement(my3Div)'. But it has to be onclick='removeElement("my3Div")'
newdiv.innerHTML = 'Element Number '+num+' has been added! <a href=\'#\'...
If the number is always in the same place (second character in string) just use the substr() function:
$st="s5tgn";
$nr=substr($st,1,1);
# substr(string,starting offset,length)
Avar Pentel
If you cant use server side script then one workaround might be playing with data URI scheme. Here is a modification which is supposed to work on FF and Opera too, but not in the same way as on IE:
function WriteToFile(sText){
with(document){
ir=createElement('iframe');
ir.id='ifr'...
Actually you can deliver your form data to another page purely with client-side JS but the question is what will you do with that data on next page...
However, exploiting HTTP get method you can pass form values to URL and then reat them on other page
--first page--
<code>
<form...
While you are using ActiveX it is IE-only solution anyway and for that case I propose more foolproof solution belowe. But I don't believe there is any crossbrowser client-side solution for that.
function WriteToFile(sText){
with(document){
ir=createElement('iframe');
ir.id='ifr'...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.