1 Replies - 234 Views - Last Post: 21 October 2011 - 11:12 AM

#1 bpr25  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 08-August 11

How can I get the name of an input?

Posted 21 October 2011 - 10:53 AM

I'd like to know how can I get a name of an input.

For example, the input of Second Name is:

  <input class=wpdev-validates-as-required" type="text" size"40" value="Schneider" name="secondname3" style=display:none;">



But I have two forms with this field Second name, which have diferent input names.

<input class=wpdev-validates-as-required" type="text" size"40" value="Smith" name="secondname4" style=display:none;">


Is there a general way to dynamically get the name instead of enter the name of the input in the code?
As you can see below, i had to add the name (secondname4) of the input.

    if(bk_af_reg.test(bk_af_element.name) != false)
	{
	 if (bk_af_element.value == "" )
		{
																
        jWPDev(".wpdev-validates- as-required").filter([name^=secondname4]").css({"display":"none"});
    bk_af_element.value  = "'.$Sname.'";
        jWPDev(".secondname4").append("'.$Sname.'");								
	    }
    }



Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: How can I get the name of an input?

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10803
  • View blog
  • Posts: 40,261
  • Joined: 27-December 08

Re: How can I get the name of an input?

Posted 21 October 2011 - 11:12 AM

Please avoid duplicate posting.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1