You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Mustafa Mahudhawala <mu...@pn3.vsnl.net.in> on 2000/11/25 05:59:36 UTC

Using Hash in HTML Select

Hello,
There Seems to be a problem with displaying a hash value by [+ +] in option Tag of HTML Select.
Following does'nt seem to work -
[- $thash{'test'}='selected'; -]
<select>
<option value='testok1' >Test 1</option>
<option value='testok2' [+ $thash{'test'} +]>Test 2</option>
</select>

The Second Option is not Selected & HTML Source View Also Does not show it.

But Following Works -
<select>
<option value='testok1' >Test 1</option>
<option value='testok2' [+ $thash{'test'} +]>Test 2 - [+ $thash{'test'} +]</option>
</select>

In HTML Page -
Select List Shows
Test 1
Test 2 - selected

Any Suggestions or Help will be Highly Appreciated.

Mustafa M

RE: Using Hash in HTML Select

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

  There Seems to be a problem with displaying a hash value by [+ +] in
option Tag of HTML Select.
  Following does'nt seem to work -
  [- $thash{'test'}='selected'; -]
  <select>
  <option value='testok1' >Test 1</option>
  <option value='testok2' [+ $thash{'test'} +]>Test 2</option>
  </select>

Embperl sets/removes the selected inside of a <option> tag, based on the
values in %fdat, so

$fdat{foo} = 'testok2' ;

<select  name="foo" >
<option value='testok1' >Test 1</option>
<option value='testok2'>Test 2</option>
</select>

will automaticly select the second option. If you don't like this put a

[- $optDisableInputScan = 1 -]

before your select, then it works like you wrote above

Gerald



   The Second Option is not Selected & HTML Source View Also Does not show
it.

  But Following Works -
  <select>
  <option value='testok1' >Test 1</option>
  <option value='testok2' [+ $thash{'test'} +]>Test 2 - [+ $thash{'test'}
+]</option>
  </select>

  In HTML Page -
  Select List Shows
  Test 1
  Test 2 - selected

  Any Suggestions or Help will be Highly Appreciated.

  Mustafa M





-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------