组合框的默认值 [英] Default value for combo box

查看:84
本文介绍了组合框的默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将值设为ASP 3.0中组合框的默认值?

我下面的内容不起作用,但我在HTML文件中看到它
以前是
的例子(如果我把它放在一个HTML文件中就可以使用,但是如果我在ASP 3.0应用程序中使用它的话,那就不用


< select name =" cboCompany" style =" text-align:right; font-size:8pt">

< option value =" 08"> 08< / option>

< option value =" 09" selected =" true"> 09< / option>

< option value =" 33"> 33< / option>

< option value =" 18"> 18< / option>

< option value =" 17"> 17< / option> ;

< / select>

How do I make a value the default value for a combo box in ASP 3.0?
What I have below does NOT work, yet I''ve seen it in HTML file
examples before (and works if I put it in a HTML file by itself, but
not if I use it in a ASP 3.0 app.
<select name="cboCompany" style="text-align:right; font-size:8pt">
<option value="08">08</option>
<option value="09" selected="true">09</option>
<option value="33">33</option>
<option value="18">18</option>
<option value="17">17</option>
</select>

推荐答案



" Doogie" ;< dn ****** @ dtgnet.com写信息

新闻:11 ********************** @ s48g2000cws.googlegr oups.com ...

"Doogie" <dn******@dtgnet.comwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...

如何将值设置为ASP 3.0中组合框的默认值?

我在下面的内容不起作用,但我在HTML文件中看到它
之前的
示例(如果我把它放在一个HTML文件中就可以使用,但是如果我在ASP 3.0应用程序中使用它的话,那就不用



< select name =" cboCompany"风格= QUOT;文本对齐:右; font-size:8pt">

< option value =" 08"> 08< / option>

< option value =" 09" selected =" true"> 09< / option>

< option value =" 33"> 33< / option>

< option value = " 18" 18< / option>

< option value =" 17"> 17< / option>

< / select>
How do I make a value the default value for a combo box in ASP 3.0?
What I have below does NOT work, yet I''ve seen it in HTML file
examples before (and works if I put it in a HTML file by itself, but
not if I use it in a ASP 3.0 app.
<select name="cboCompany" style="text-align:right; font-size:8pt">
<option value="08">08</option>
<option value="09" selected="true">09</option>
<option value="33">33</option>
<option value="18">18</option>
<option value="17">17</option>
</select>



虽然以上是无效的html,但它应该适用于大多数浏览器,因为

它们似乎忽略了selected之后的内容br />

在HTML 4.01及以下版本中有效:< option value =" 09"选择> 09< / option>

在xhtml中有效:< option value =" 09" selected =" selected"> 09< / option>


您尝试的内容也适用于ASP应用中的大多数浏览器,因为所有

asp确实是渲染html。因此ASP不是问题。


-

Mike Brind

While the above is not valid html, it should work in most browsers, because
they appear to ignore what comes after "selected"

Valid in html 4.01 and below: <option value="09" selected>09</option>
Valid in xhtml: <option value="09" selected="selected">09</option>

What you tried should also work in most browsers in an ASP app, because all
asp does is render html. ASP is therefore not an issue.

--
Mike Brind


虽然以上是不是有效的HTML,它应该适用于大多数浏览器,因为
While the above is not valid html, it should work in most browsers, because

它们似乎忽略了选定之后的内容。
they appear to ignore what comes after "selected"



什么是无效的?我想让它有效,所以如果它无效

请告诉我在哪里。

What is invalid about it? I want to make it valid so if it''s invalid
please show me where.


在HTML 4.01及以下版本中有效:< ; option value =" 09"选择> 09< / option>

在xhtml中有效:< option value =" 09"选定= QUOT;选择"> 09< /选项>
Valid in html 4.01 and below: <option value="09" selected>09</option>
Valid in xhtml: <option value="09" selected="selected">09</option>



这些都不奏效。我可以在一个简单的html

页面中创建这个组合框,它工作正常。但如果我把它放在ASP 3.0页面中,选项09

不是默认的。选项08(第一个)是。除了把09放在第一位之外还有其他的吗?

Neither of these work. I can create this combo box in a simple html
page and it works fine. But if I put it in an ASP 3.0 page, option 09
is not the default one. Option 08 (the first one) is. Is there some
other way - other than putting 09 first?




Doogie ; < dn ****** @ dtgnet.com写信息

新闻:11 ********************** @ 8g2000cwh .googlegrou ps.com ...

"Doogie" <dn******@dtgnet.comwrote in message
news:11**********************@8g2000cwh.googlegrou ps.com...

>虽然以上内容不是有效的html,但它应该适用于大多数浏览器,<因为他们似乎忽略了选中之后的内容。
>While the above is not valid html, it should work in most browsers,
because
they appear to ignore what comes after "selected"



什么是无效的?我想让它有效,所以如果它无效

请告诉我在哪里。


What is invalid about it? I want to make it valid so if it''s invalid
please show me where.


>在html 4.01及以下版本中有效:< option value =" 09"选择> 09< / option>
在xhtml中有效:< option value =" 09"选定= QUOT;选择"> 09< /选项>
>Valid in html 4.01 and below: <option value="09" selected>09</option>
Valid in xhtml: <option value="09" selected="selected">09</option>



这些都不奏效。我可以在一个简单的html

页面中创建这个组合框,它工作正常。但如果我把它放在ASP 3.0页面中,选项09

不是默认的。选项08(第一个)是。是否有一些

其他方式 - 除了将09放在首位?


Neither of these work. I can create this combo box in a simple html
page and it works fine. But if I put it in an ASP 3.0 page, option 09
is not the default one. Option 08 (the first one) is. Is there some
other way - other than putting 09 first?



您是否查看了ASP脚本生成的HTML源代码?我怀疑它没有完全按照你的预期产生
,因为浏览器并不关心

标记是静态的还是动态的,只要它是正确的。 br />
-Mark

Did you view the HTML source as generated by your ASP script? I suspect it
is not generating exactly as you expect, because the browser doesn''t care if
the markup is static or dynamic, as long as its correct.
-Mark


这篇关于组合框的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆