行动取决于下拉 [英] Action depending on drop down

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

问题描述




我有一个下拉菜单

Hi

I have a drop down thus

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | 换行 | 行号

推荐答案





我有一个下拉菜单



< form name = frmUtils method = POSTaction ="">

< select name = Do>

< option> Add< ; / option>

< option>删除< /选项>

<选项>更新< /选项>

< / select> ;

< / form>

我希望表单操作根据选择进行更改,即


如果选择索引是添加

action = add.php


如果选择索引是删除

action = delete.php


如果选择更新添加

action = update.php


有人帮助
Hi

I have a drop down thus


<form name = frmUtils method = POSTaction = "">
<select name = Do>
<option>Add</option>
<option>Delete</option>
<option>Update</option>
</select>
</form>

I want the form action to change based on the selection ie

if selected Index is Add
action = add.php


if selected Index is Delete
action = delete.php


if selected Updateis Add
action = update.php

Somebody help



多数民众赞成听起来很棘手。你能在dropdown onchange事件上使用一些javascript吗?这可以使用document.getElementById来编写表单的innerHtml(给表单一个与名称相同的id)并添加appropritae动作。


这就是行我的第一次尝试。去吧,让我知道你是怎么过的。我很乐意提供帮助。


干杯

nathj

Thats sounds tricky. Could you use some javascript on the dropdown onchange event? This could use document.getElementById to write the innerHtml of the form (give the form an id that is the same as the name) and add the appropritae action.

That would be the lines of my first attempt. Have a go and let me know how you get on. I''ll be happy to help.

Cheers
nathj


你应该以不同的方式处理这种情况。 br />
You should approach the situation differently.

展开 | 选择 | Wrap | 行号



您应该以不同的方式处理这种情况。 br />
You should approach the situation differently.

展开 | 选择 | Wrap | 行号


这篇关于行动取决于下拉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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