Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing user defined attribute in mozilla 1

Status
Not open for further replies.

Weese

Programmer
Apr 3, 2003
17
I am having an input field like the below one.

<input type=&quot;text&quot; id=&quot;txtSelectEmployee&quot; size=&quot;55&quot; maxlength=&quot;38&quot; requiredInd = &quot;R&quot; value=&quot; &quot; />

In Ie, I am able to do like the below,

if(frm.txtSelectEmployee.requiredInd ==&quot;R&quot;)
-- code here

But this is not working in Mozilla. Any Idea.
 
use getElementById() and getAttribute()

var el = document.getElementById(&quot;txtSelectEmployee&quot;);
var reqInd = el.getAttribute(&quot;requiredInd&quot;);

note that these methods are DOM methods and will work for ALL DOM-compliant browsers...

=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top