4 Replies - 328 Views - Last Post: 25 July 2011 - 09:37 PM

#1 Student7574  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 09-July 11

What is attribute in option tag for integer?

Posted 24 July 2011 - 09:59 PM

What is attribute in option tag that for integer? For example below,

<select name="example">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>


the value attribute is for text. If I use them for relational operator, it would be error because it is string. So,I want to replace it for integer, so i can use the integer value with relational operator. Anyone can help me?

Is This A Good Question/Topic? 0
  • +

Replies To: What is attribute in option tag for integer?

#2 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,238
  • Joined: 08-June 10

Re: What is attribute in option tag for integer?

Posted 24 July 2011 - 10:21 PM

attribute values are always strings, period. if you want to make it an integer, cast it to to the integer type in your favourite programming language.
Was This Post Helpful? 1
  • +
  • -

#3 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1368
  • View blog
  • Posts: 3,455
  • Joined: 28-November 09

Re: What is attribute in option tag for integer?

Posted 25 July 2011 - 01:29 AM

You're confusing a markup language with a programming language. Look into php.
Was This Post Helpful? 0
  • +
  • -

#4 Student7574  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 09-July 11

Re: What is attribute in option tag for integer?

Posted 25 July 2011 - 08:53 PM

I'm using jsp. Can anyone show me simple example how to cast the value into integer? I'm clueless now @.@
for example,
option 1 is integer 100
option 2 is integer 200
option 3 is integer 300
Was This Post Helpful? 0
  • +
  • -

#5 Student7574  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 09-July 11

Re: What is attribute in option tag for integer?

Posted 25 July 2011 - 09:37 PM

I get it already from this url http://www.javacoffe...aq/faq0026.html
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1