简单方案? [英] Easy solution?

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

问题描述

我希望有一个简单的解决方案,我没有看到

更有经验的人。


我想要的一切要做的就是将选项标记标记为选中....


<%

hourCounter = 1

do while hourCounter < = 12%>

< option value ="<%= hourCounter%>" <%if hourCounter =

hour(rsCalendarEdit(" fld_calendar_DateTime")))然后Response.write"

selected"结束如果%>><%= hourCounter%>< / option>

<%hourCounter = hourCounter + 1

循环

%>


如果时间是PM,那就麻烦了。你可以看到我有一个问题。是

这里有一个方法或属性,我可以实现,我没有看到?


谢谢!

I''m hoping for an easy solution to this that I''m not seeing that
someone more experienced will.

All I want to do it mark an option tag as selected....

<%
hourCounter = 1
Do WHILE hourCounter <= 12 %>
<option value="<%=hourCounter%>" <%If hourCounter =
hour(rsCalendarEdit("fld_calendar_DateTime")) Then Response.write "
selected" End If %>><%=hourCounter%></option>
<% hourCounter = hourCounter + 1
Loop
%>

The trouble is if the time is "PM" I have a problem as you can see. Is
there a method or property here I can implement that I''m not seeing?

Thanks!

推荐答案

哪里有PM进来?您的数据是否存储为实际日期/时间数据?尝试

简化代码,至少就可读性和更少的b $ b读取对象数据而言。

<%


Dim iSelectedHour

iSelectedHour = CInt(小时(rsCalender.Fields.Item(" fld_calendar_Dat eTime))))

hourCounter = 1

同时执行HourCounter< = 12


%>

< option value =" <%= hourCounter%>"<%If HourCounter = iSelectedHour然后

Response.Write"已选择"%>><%= hourCounter%>< / option>

<%

hourCounter = hourCounter + 1

循环

%>

虽然,这并没有太大变化。你能解释一下PM问题吗?你有什么吗?

雷在家里



"其他约翰<き***** @ yahoo.com>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...
Where''s PM coming in? Is your data stored as actual date/time data? Try
simplifying the code a little bit, at least as far as readability and fewer
reads of object data.
<%

Dim iSelectedHour
iSelectedHour = CInt(Hour(rsCalender.Fields.Item("fld_calendar_Dat eTime")))

hourCounter = 1
Do while hourCounter <= 12

%>
<option value="<%=hourCounter%>"<% If hourCounter = iSelectedHour Then
Response.Write " selected"%>><%=hourCounter%></option>
<%
hourCounter = hourCounter + 1
Loop
%>
Although, this doesn''t really change much. Can you explain what PM problem
you''re having?
Ray at home


"the other john" <ki*****@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
我希望有一个简单的解决方案,我没有看到
更有经验的人。

所有我想做的都标记一个选项标签选择....

<%
hourCounter = 1
在whileCounter< = 12%>
< option value ="< ;%= hourCounter%GT;" <%if hourCounter =
hour(rsCalendarEdit(" fld_calendar_DateTime")))然后Response.write
selected结束如果%>><%= hourCounter%>< / option>
<%hourCounter = hourCounter + 1
循环
%>

谢谢!
I''m hoping for an easy solution to this that I''m not seeing that
someone more experienced will.

All I want to do it mark an option tag as selected....

<%
hourCounter = 1
Do WHILE hourCounter <= 12 %>
<option value="<%=hourCounter%>" <%If hourCounter =
hour(rsCalendarEdit("fld_calendar_DateTime")) Then Response.write "
selected" End If %>><%=hourCounter%></option>
<% hourCounter = hourCounter + 1
Loop
%>

The trouble is if the time is "PM" I have a problem as you can see. Is
there a method or property here I can implement that I''m not seeing?

Thanks!



另一个约翰 <き***** @ yahoo.com>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...
"the other john" <ki*****@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
我希望有一个简单的解决方案,我没有看到
更有经验的人。

所有我想做的都标记一个选项标签选择....

<%
hourCounter = 1
在whileCounter< = 12%>
< option value ="< ;%= hourCounter%GT;" <%if hourCounter =
hour(rsCalendarEdit(" fld_calendar_DateTime")))然后Response.write
selected结束如果%>><%= hourCounter%>< / option>
<%hourCounter = hourCounter + 1
循环
%>

谢谢!


PM是怎样的?有问题吗?


小时()=

"返回0到23之间的整数,

包括在内,代表一天中的小时。


因此,修改你的代码,这应该工作;

(假设你的字段是DateTime字段):


< form>

< select>

<%

Dim hourCounter

hourCounter = 0

Dim hourRecord

hourRecord = Hour(rsCalendarEdit(" fld_calendar_DateTime"))

Do while HourCounter< 24

%>

< option value ="<%= hourCounter%>"

<%

如果hourCounter = hourRecord那么

Response.Write"选择

结束如果

%>
I''m hoping for an easy solution to this that I''m not seeing that
someone more experienced will.

All I want to do it mark an option tag as selected....

<%
hourCounter = 1
Do WHILE hourCounter <= 12 %>
<option value="<%=hourCounter%>" <%If hourCounter =
hour(rsCalendarEdit("fld_calendar_DateTime")) Then Response.write "
selected" End If %>><%=hourCounter%></option>
<% hourCounter = hourCounter + 1
Loop
%>

The trouble is if the time is "PM" I have a problem as you can see. Is
there a method or property here I can implement that I''m not seeing?

Thanks!

How is "PM" a problem?

Hour() =
"Returns a whole number between 0 and 23,
inclusive, representing the hour of the day."

Thus, modifying your code, this should work;
(presuming your field is DateTime field):

<form>
<select>
<%
Dim hourCounter
hourCounter = 0
Dim hourRecord
hourRecord = Hour(rsCalendarEdit("fld_calendar_DateTime"))
Do While hourCounter < 24
%>
<option value="<%=hourCounter%>"
<%
If hourCounter = hourRecord Then
Response.Write " selected"
End If
%>



<%= hourCounter%>

< / option>

<%hourCounter = hourCounter + 1

循环

%>

< / select>

< / form>


或者你不想使用军事时间吗?


<%=hourCounter%>
</option>
<% hourCounter = hourCounter + 1
Loop
%>
</select>
</form>

Or do you not want to use military time?


与PM有关的麻烦是客户通过Dropbox选择他们的时间

。它用于编辑页面的脚本,数据库中已存在时间

。 PM的问题是当这个脚本正在寻找6的时间时,它是PM。但是数据库中的时间是

" 18"

The trouble I''m having with PM is that the client chooses their time
via a dropbox. The script it intended for an edit page where the time
already exists in the database. The trouble with PM is when the time
is PM this script is looking for "6" but the time in the database is
"18".


这篇关于简单方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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