J
Jeff
Hey
I'm trying to use javascript to dynamically add text to the web page. It
should work like this: The user tryes to click on a link in the web page.
The link executes a javascript method, which checks if a hidden html field
has a value. If that hidden field has no value then the javascript should
display a message (not using alert, but insert a html element into the code)
on the web page telling the user that he need to save the form before
clicking on that link..
Below is the approach I've tryed to solve this by... I just posted the code
I have problem with... the check if the hidden field has a value etc is
working okay, so I didn't post it... if you need to see that code too, just
tell me and I'll post that too.
This javascript gives an Invalid Argument error
This is the html code the javascript below are trying to insert an element
before
<div id="error"></div>
var oNewP = document.createElement("div");
var oText = document.createTextNode("Hello World");
oNewP.appendChild(oText);
var v1 = document.getElementById("error");
document.body.insertBefore(oNewP, v1);
Any suggestions?
Best Regards
Jeff
I'm trying to use javascript to dynamically add text to the web page. It
should work like this: The user tryes to click on a link in the web page.
The link executes a javascript method, which checks if a hidden html field
has a value. If that hidden field has no value then the javascript should
display a message (not using alert, but insert a html element into the code)
on the web page telling the user that he need to save the form before
clicking on that link..
Below is the approach I've tryed to solve this by... I just posted the code
I have problem with... the check if the hidden field has a value etc is
working okay, so I didn't post it... if you need to see that code too, just
tell me and I'll post that too.
This javascript gives an Invalid Argument error
This is the html code the javascript below are trying to insert an element
before
<div id="error"></div>
var oNewP = document.createElement("div");
var oText = document.createTextNode("Hello World");
oNewP.appendChild(oText);
var v1 = document.getElementById("error");
document.body.insertBefore(oNewP, v1);
Any suggestions?
Best Regards
Jeff