getting values of non-standard attributes

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Mar 2007
Posts: 29
Reputation: blufab is an unknown quantity at this point 
Solved Threads: 1
blufab blufab is offline Offline
Light Poster

getting values of non-standard attributes

 
0
  #1
Nov 20th, 2008
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.

  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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 24
Reputation: sasankasekhar is an unknown quantity at this point 
Solved Threads: 3
sasankasekhar's Avatar
sasankasekhar sasankasekhar is offline Offline
Newbie Poster

Re: getting values of non-standard attributes

 
0
  #2
Nov 21st, 2008
Originally Posted by blufab View 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.

  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...
IF SOMEONE FEELS THAT THEY HAD NEVER MADE A MISTAKE IN THEIR LIFE, THEN  IT MEANS THEY HAD NEVER TRIED A NEW THING IN THEIR LIFE
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 884 | Replies: 1
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC