onClick Event
Hi Guys
I am not sure how to put the code into this post so i will have to do it direct
I have a little problem here.
Using onClick
On a checkbox wrapped in a div I have an onClick event in the checkbox which changes it from unChecked to Checked and this works fine and it change the checkbox propertes from
<checkbox id="somename" name="somename" value="somevalue" onClick"callProcedureA"
to
<checkbox id="somename" name="somename" value="somevalue" checked="checked" onClick"callProcedureB">
The problem is even though the properties have changed (This can be seen when i view the source) It is not actually live unless I refresh the page
Here is the code used
function changeContentA(id,shtml) {
if (document.getElementById || document.all) {
var el = document.getElementById? document.getElementById(id): document.all[id];
if (el && typeof el.innerHTML != "undefined") el.innerHTML = shtml;
}
}
var msga = "<input type=\"checkbox\" value=\"'value'\" id=\"vunbook\" name=\"vunbook\" checked=\"checked\" onClick=changeContentB (\'vadiv',msgb')\" />"
function changeContentb(id,shtml) {
if (document.getElementById || document.all) {
var el = document.getElementById? document.getElementById(id): document.all[id];
if (el && typeof el.innerHTML != "undefined") el.innerHTML = shtml;
}
}
var msgb = "<input type=\"checkbox\" value=\"'value'\" id=\"vbook\" name=\"vbook\" onClick=changeContentA (\'vadiv',msga')\" />"
Here is the checkbox before procedure called
<input type="checkbox" onClick="changeContentA('vadiv',msga);" value="'value'" id="vbook'" name="vbook"/>
ad then after
<input type="checkbox" value="'value'" id="vunbook'" name="vunbook" checked="checked" onClick="changeContentb('vadiv',msgb);"/>
So it all works fine. But when you click again it will not change back again.
Any ideas would be greatly apprecoated.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks