用于检查n行数n个值的脚本 [英] Script to check n number of values in n number of rows

查看:91
本文介绍了用于检查n行数n个值的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正面临着一个非常特殊的问题。


在我的一个页面中,我打印了行数取决于我在上一页填写的数量,即如果在前一页中填写数量为3,则会在当前页面上打印3行,或者如果在上一页中输入5行,则会在我的页面中打印5行当前页面&等等。


现在的问题是,我想检查每行中的必填字段是否已填写,或者不是。如果不是ONSUBMIT,页面应显示警告信息,说明必须填写指定的字段。

展开 | 选择 | Wrap | 行号

解决方案




在javascript中你不能使用''。''这样参考 - 试着参考:


f1 [''inventory''+ i] .value


代替。这应该适用于您的目的,直到我是您要添加到stringobject''inventory''的唯一变量?否则我们需要更多关于你要检查的''数据结构'的信息。


问候......希望这有帮助;)


和等一下;)


上面的解决方案当然不是很光滑,看看下面的例子:

展开 | 选择 | Wrap | 行号





感谢您的投入。


很抱歉我无法提前回复你的帖子。


嗯......为你提供关于这个问题的最新消息我能够解决一个检查我页面上所有空白文本框的问题。


在同一模块上工作时出现了一个新的情况,这再次让我头疼。


在整个表格中,我的两个字段是这样的,即使我们的表格中的任何一个是空的,我的表格也可能被提交。但是,如果两个字段都是空的,我的函数应该返回一个警告,说明必须填写两个字段中的任何一个。

展开 | 选择 | Wrap | 行号

Hi,

I''m facing a pretty peculiar problem.

In one of my pages I print the number of rows depending upon the number of Qty I got filled in my previous page i.e. If Qty is filled in as 3 in previous page 3 rows would be printed on my current page or, if 5 being entered in the previous page 5 rows would get printed in my current page & so on.

Now the problem is, I want to check whether the required fields in each row has been filled or, not. If not ONSUBMIT the page should display an alert msg stating the specified field has to be filled.

Expand|Select|Wrap|Line Numbers

解决方案

hi,

in javascript you cannot use the ''.'' reference that way - try to refer with:

f1[''inventory'' + i].value

instead. this should work for your purpose until i is the only variable that you want to add to your stringobject ''inventory''? otherwise we need more information about the ''datastructure'' you want to check.

greetings ... hope this helps ;)


and wait a moment ;)

the solution above is of course not very slick have a look at the following example:

Expand|Select|Wrap|Line Numbers


Hi,

Thanks for your inputs.

Am so sorry I couldn''t reply earlier to your post.

Well....to update you on the latest on this problem I was able to solve one issue of checking all blank textboxes on my page.

While working on the same module a new condition has arise which is again giving me some headache.

Of the whole form two of my fields are as such that my form may get submitted even if any one of them is empty. However, if both the fields are empty my function should return back an alert stating "Any one of the two fields have to be filled".

Expand|Select|Wrap|Line Numbers


这篇关于用于检查n行数n个值的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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