How to get the username attribute from the HTML input tag attribute from generic name in c++

<input type="text" name="username" id="username" class="textinput" />

This is my HTML input line, I iterated this tag and stored all input attributes in map. I want to get the "username by checking the type="text" from this line but my question is the username can changes in different form like this example input tag.

Example : <input type="text" name="userid" id="userid" class="textinput" />

So how can I get this username attribute generically if it is different in different form using c++?

Thanks in advance..
Last edited on
I want to get the "username by checking the type="text" from this line

You are confusing me. The value "username" is associated with the name and id attributes. It is in no way related to the type attribute.

You have an input tag, and the tag has 4 attributes: type, name, id and class. There is no username attribute, so you cannot get the "username attribute" from these input tags.

Your 2 inputs have the following attribute values:

Attribute	Tag1		Tag2
---------	----		----

type		"text"		"text"
name		"username"	"userid"
id		"username"	"userid"
class		"textinput"	"textinput"

Maybe you need to describe a little bit better what you are trying to get.

TinyXml is an xml parser. You can view its source code. Just use the library and have fun.

There is no username attribute

since it's an input text which class is userid, one could easily guess he's looking for the content of the "value" attribute. Which is actually not set hence his question still doesn't make sense.
Last edited on
Topic archived. No new replies allowed.