选项组帮助初学者? [英] Option group help for a beginner?

查看:110
本文介绍了选项组帮助初学者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个学校项目(ASP),我必须从三个不同且相同的地方调用三个不同的ASP

页面(除了表格action,
$ b显然是$ b)HTM页面。这个我没有问题。

然而,作为个人学习项目和挑战,我决定看看我是否可以编码我的初始HTM页面来调用任何一个三个ASP页面,取决于选项组条件下的
。 (3个按钮 - id =" function",id =" sub",

id =" class")

我希望它会像将函数名称放在我的表单中

" action"声明。在函数中我认为我会使用switch语句

来确定选项组条件下的动作。

昨晚玩了几个小时之后,我觉得我已经惨遭失败了,现在是时候寻找一些知识渊博的建议。


有人可以帮忙吗?或者直接告诉我一个样品?


谢谢

-


/ Sean the Mc /

我没有失败。我刚刚找到了10,000种不能工作的方法。

- 托马斯·阿尔瓦·爱迪生(1847-1931)

I have a school project (ASP) in which I have to call three different ASP
pages from three different and identical (except for the form "action",
obviously) HTM pages. This I have no problem with.
However, as a personal learning project and challenge, I decided to see if I
could code my initial HTM page to call any of the three ASP pages, depending
on the condition of an option group. (3 buttons - id="function", id="sub",
id="class")
I was hoping it would be as simple as putting a function name in my form
"action" statement. In the function I thought I would use a switch statement
to determine the action from the condition of the option group.
After playing around with this for a couple hours last night, I decided I
had failed miserably, and it was time to look for some knowledgeble advice.

Can someone help? Or direct me to a sample somewhere?

Thank You
--

/ Sean the Mc /
"I have not failed. I''ve just found 10,000 ways that won''t work."
- Thomas Alva Edison (1847-1931)

推荐答案

在文章< RWfyc.5365
In article <RWfyc.5365


qg.4323@lakeread06> ;, Die!FrigginSpammersDieDie!

@ IHateSpam.Net启发我们。 ..
qg.4323@lakeread06>, Die!FrigginSpammersDieDie!
@IHateSpam.Net enlightened us with...
然而,作为个人学习项目和挑战,我决定看看我是否可以编写我的初始HTM页面来调用三个ASP页面中的任何一个,具体取决于
在选项组的条件下。 (3个按钮 - id =" function",id =" sub",
id =" class")
我希望它就像在我的表单中放一个函数名一样简单
行动声明。在函数中我认为我会使用switch语句
来确定选项组条件下的动作。
昨晚玩了几个小时后,我决定我
失败了,现在是时候寻找一些知识渊博的建议。

有人可以帮忙吗?或者直接将我带到某个地方的样本?
However, as a personal learning project and challenge, I decided to see if I
could code my initial HTM page to call any of the three ASP pages, depending
on the condition of an option group. (3 buttons - id="function", id="sub",
id="class")
I was hoping it would be as simple as putting a function name in my form
"action" statement. In the function I thought I would use a switch statement
to determine the action from the condition of the option group.
After playing around with this for a couple hours last night, I decided I
had failed miserably, and it was time to look for some knowledgeble advice.

Can someone help? Or direct me to a sample somewhere?




表单的操作应该是默认的无javascript的页面

页面。即action =" noscript.html"。或者它可以是一个默认页面 -

如果用户没有脚本或没有它你想要发生什么

禁用。

表单的onSubmit应该调用该函数,假设你的按钮

是一个提交按钮。即type =" submit"和onSubmit ="返回myFunction

()"。

然后该函数可以查看选项组并更改

位置。相应的href属性。然后它应该返回false,所以

表单实际上并没有提交(位置更改应该在

之前触发,但是比抱歉更安全)。


哦,并且最好不要将与其他东西同名的东西命名为

。不要将元素命名为功能。或id或类或类或者

" name"等等。大多数时候这不是一个问题,但它可以,所以

养成不做的习惯可以让你后来头疼。

在开头用数字命名事物也是一样的,例如

name =" 2btn"或者其他一些。这在技术上并不违法,但有时可能导致

麻烦。


-

-

~kaeli~

墨菲的定律#2030:如果一开始你没有成功,就要破坏你所尝试的所有证据。
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


What-a-Tool写道:

< snip>
What-a-Tool wrote:
<snip>
然而,作为个人学习项目和挑战,我决定看看我是否可以编写我的初始HTM页面来调用三个ASP页面中的任何一个页面,


作为一个学习练习,公平,作为一个设计有潜力的决定

现实世界的应用程序非常谨慎,因为没有这个HTML

表格和服务器端ASP是10 0%可靠(或至少尽可能接近
)但是这样整个系统变得依赖于客户端喷射的b $ b $,这距离100%很远可靠或

客户可以普遍使用。

,具体取决于期权组的状况。 (3个按钮 -
id =" function",id =" sub",id =" class")


你的意思是< input type =" ;无线电">纽扣?调用它们的选项很可能会误导任何懂HTML的人,因为他们很可能会想到OPTION元素(不是按钮)。

我希望它就像在我的表单中添加一个函数名称动作一样简单。声明。


表单的action属性指定为包含一个URL,因此在执行脚本时没有任何价值(除了极少数浏览器

使用javascript :协议是一个严重误导的可疑

hack,并且总是不必要的。)

In函数我以为我会使用
开关语句来确定
选项组条件下的动作。
昨晚玩了几个小时之后,我我决定失败了,现在是时候寻找一些知识渊博的建议了。
However, as a personal learning project and challenge, I decided to
see if I could code my initial HTM page to call any of the three ASP
pages,
As a learning exercise fair enough, as a design decision with potential
real world applications exercise extreme caution as without this HTML
forms and server-side ASP are 100% reliable (or at least as close as
possible) but with this the whole system becomes dependent on
client-side squirting, which is a long way from 100% reliable or
universally available on clients.
depending on the condition of an option group. (3 buttons -
id="function", id="sub", id="class")
Do you mean <input type="radio"> buttons? Calling them options is likely
to be misleading to anyone who understands HTML because they are likely
to think of OPTION elements (which are not buttons).
I was hoping it would be as simple as putting a function
name in my form "action" statement.
The action attribute of a form is specifies as containing a URL so it is
of no value in executing scripts (except on a very few browsers where
its use with the javascript: protocol is a seriously misguided dubious
hack, and always unnecessary).
In the function I thought I would use a
switch statement to determine the action from the condition of the
option group.
After playing around with this for a couple hours last night, I
decided I had failed miserably, and it was time to look for some
knowledgeble advice.




阅读新闻组常见问题解答第2.3节及其链接的页面到。


< URL: http ://www.jibbering.com/faq/#FAQ2_3 >


触发有意设置的功能的最佳位置 - 动作 -
表格的
属性来自onsubm它处理程序,因为onsubmit处理程序

在表单提交时被调用,但在实际提交之前(因此

它可能会被取消,例如,结果失败的客户端

验证)。如果onsubmit处理程序中的代码或从

调用的函数,则设置表单'' - action - property,然后在表单中使用分配的URL为

提交。


Richard。



Read section 2.3 of the newsgroup FAQ and the pages it links to.

<URL: http://www.jibbering.com/faq/#FAQ2_3 >

The best place to trigger a function that intends to set the - action -
property of a form is from the onsubmit handler, as the onsubmit handler
is called when the form is submitted, but prior to the actual submit (so
it may be cancelled, for example, as a result of failed client-side
validation). If code in the onsubmit handler, or a function called from
there, sets the form''s - action - property then the URL assigned will be
used when the form is submitted.

Richard.


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

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