943,623 Members | Top Members by Rank

Ad:
Nov 20th, 2008
0

getting values of non-standard attributes

Expand Post »
Is it possible to get the value of a non-standard attribute in firefox?
I am trying to capture the value of attribute required. In IE I am able to get the value using document.form.required but in firefox it just returns undefined.

html Syntax (Toggle Plain Text)
  1. <html>
  2. <head><title></title></head>
  3. <body>
  4. <form id="form" name="form">
  5. <input type="text" name="txt" id="txt" value="val" required="1" />
  6. </form>
  7. </body>
  8. </html>

Thanks in advance.
Last edited by blufab; Nov 20th, 2008 at 12:53 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Light Poster
blufab is offline Offline
29 posts
since Mar 2007
Nov 21st, 2008
0

Re: getting values of non-standard attributes

Click to Expand / Collapse  Quote originally posted by blufab ...
Is it possible to get the value of a non-standard attribute in firefox?
I am trying to capture the value of attribute required. In IE I am able to get the value using document.form.required but in firefox it just returns undefined.

html Syntax (Toggle Plain Text)
  1. <html>
  2. <head><title></title></head>
  3. <body>
  4. <form id="form" name="form">
  5. <input type="text" name="txt" id="txt" value="val" required="1" />
  6. </form>
  7. </body>
  8. </html>

Thanks in advance.

Try this:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. document.getElementById('txt').attributes['required'].value;

Regards...
Reputation Points: 10
Solved Threads: 3
Newbie Poster
sasankasekhar is offline Offline
24 posts
since Jan 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Search data Using ajax without press search button??
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Converting document.writeln output to textarea box





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC