Hi all,
I have to create a check box in javascript i just created the checkbox field and called a function in onclick.but onclick event is not firing.i'm getting an error indicating that chkbox has no properties.i have to fire an event on click this checkbox can anyone please help me in resolving the problem here i'm sending my code part.
var cellText=document.createElement("input");
cellText.type="checkbox";
//cellText.align="right"
cellText.name="chkbox"
cellText.onClick="return changestatus(this,this.parentNode,document.form_enc);"
please help me i'm not getting nay rference to sort out this issue
Thanking you in adavance
vani.
amaravanich
0
Newbie Poster
Recommended Answers
Jump to Posttry changing:
cellText.onClick="return changestatus(this,this.parentNode,document.form_enc);"
to:
cellText.onclick=function(){return changestatus(this,this.parentNode,document.form_enc);};
That's a weird error message though... You tend to get that error (in firefox) when you try and access html elements out of context (i.e. without a <html><body> /etc around them), or when you try to access …
All 3 Replies
MattEvans
473
Veteran Poster
Team Colleague
Featured Poster
amaravanich
0
Newbie Poster
yurj
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.