使用用户字段创建链接 [英] using a user field to create a link
问题描述
嗨大师
我想做的是设置一个小形式,人们可以在这里设置一个
日期(例如Day:[。 ...]月..... [....]年[......],其中......是用户
输入),随后,将把它们带到一个锚(< A
NAME = {date}>< / A>),与他们选择的日期有关。你可能已经有了b $ b现在已经解决了,对于java脚本我是一个真正的新手。
我使用谷歌进行浏览,但是远没有运气
如果你能提供帮助请告诉我
干杯
Nicolaas
Hi Gurus
What I would like to do is to setup a little form where people can put in a
date (e.g. Day: [....] Month..... [....] Year [......], where ... is user
input) and subsequently, will take them through to an anchor (<A
NAME={date}></A>), relating to the date that they selected. As you may have
worked out by now, I am a real novice when it comes to java script.
I have a browse using Google, but so far no luck
Let me know if you can help
Cheers
Nicolaas
推荐答案
" WindAndWaves" <交流**** @ ngaru.com>在消息中写道
news:oT ******************* @ news.xtra.co.nz ...
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:oT*******************@news.xtra.co.nz...
嗨大师
我想做的是设置一个人们可以投入
a日期的小表格(例如Day:[....] Month ..... [....]年[......],其中......是用户
输入)然后,将它们带到一个锚点(< A
NAME = {date }>< / A>),与他们选择的日期有关。至于你现在已经解决了
,我在java脚本方面是一个真正的新手。
我使用谷歌浏览,但到目前为止没有运气
<如果你能提供帮助,请告诉我
干杯
Nicolaas
Hi Gurus
What I would like to do is to setup a little form where people can put in a date (e.g. Day: [....] Month..... [....] Year [......], where ... is user
input) and subsequently, will take them through to an anchor (<A
NAME={date}></A>), relating to the date that they selected. As you may have worked out by now, I am a real novice when it comes to java script.
I have a browse using Google, but so far no luck
Let me know if you can help
Cheers
Nicolaas
而不是链接,如何关于只是去页面?
这会让你开始吗?请注意自动换行。
< html>
< head>
< title> datelink.htm< / title>
< script type =" text / javascript">
function ddmmyy(){
var dd = document。 getElementById(" dd")。value;
var mm = document.getElementById(" mm")。value;
var yy = document.getElementById(" yy")。value;
var zz = yy + mm + dd;
location.href = zz +" .htm";
}
< / script>
< / head>
< body>
<表格>
日:< input type =" text"名称= QUOT峰; dd"大小= QUOT; 2英寸;> & nbsp;
月:< input type =" text"命名= QUOT;毫米"大小= QUOT; 2英寸;> & nbsp;
年份:< input type =" text"名称= QUOT; YY"大小= QUOT; 4英寸;> & nbsp;
< input type =" button"值= QUOT确定]; onclick =" ddmmyy()">
< / form>
< / body>
< / html>
Instead of a link, how about just going to the page?
Will this get you started? Watch for word-wrap.
<html>
<head>
<title>datelink.htm</title>
<script type="text/javascript">
function ddmmyy() {
var dd = document.getElementById("dd").value;
var mm = document.getElementById("mm").value;
var yy = document.getElementById("yy").value;
var zz = yy + mm + dd;
location.href = zz + ".htm";
}
</script>
</head>
<body>
<form>
Day: <input type="text" name="dd" size="2">
Month: <input type="text" name="mm" size="2">
Year:<input type="text" name="yy" size="4">
<input type="button" value="OK" onclick="ddmmyy()">
</form>
</body>
</html>
McKirahan写道:
McKirahan wrote:
" WindAndWaves" <交流**** @ ngaru.com>在消息中写道
新闻:oT ******************* @ news.xtra.co.nz ...
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:oT*******************@news.xtra.co.nz...
嗨大师
我想做的是设置一个人们可以放入
Hi Gurus
What I would like to do is to setup a little form where people can put in
a
日期的小表格(例如Day :[....]月..... [....]年[......],其中......是用户
输入)随后,将把他们带到一个锚点(< A
NAME = {date}>< / A>),与他们选择的日期有关。你可能
date (e.g. Day: [....] Month..... [....] Year [......], where ... is user
input) and subsequently, will take them through to an anchor (<A
NAME={date}></A>), relating to the date that they selected. As you may
have
现在已经解决了,在java脚本方面我是一个真正的新手。
<我有一个使用谷歌浏览,但到目前为止没有运气
如果你能帮忙请告诉我
Nicolaas
worked out by now, I am a real novice when it comes to java script.
I have a browse using Google, but so far no luck
Let me know if you can help
Cheers
Nicolaas
而不是链接,只是去页面怎么样?
这会让你开始吗?注意自动换行。
< html>
< head>
< title> datelink.htm< / title>
< script type = " text / javascript">
函数ddmmyy(){
var dd = document.getElementById(" dd")。value;
Instead of a link, how about just going to the page?
Will this get you started? Watch for word-wrap.
<html>
<head>
<title>datelink.htm</title>
<script type="text/javascript">
function ddmmyy() {
var dd = document.getElementById("dd").value;
var dd = document.forms [''myForm'']。elements [''dd'']。value;
var mm = document.getElementById(" mm")。value;
var mm = document.forms [''myForm'']。elements [''mm'']。value;
var yy = document。的getElementById(QUOT; YY")。值;
var yy = document.forms [''myForm'']。elements [''yy'']。value;
Picking使用getElementByID时通过name属性的元素是
应该避免的IE-ism。并且,表单集合更广泛支持。
var zz = yy + mm + dd;
location.href = zz +" .htm" ;
document.location.href =" http://" + yy + mm + dd +" .htm";
返回false;
}
< / script>
< / head> ;
< body>
< form>
< form name =" myForm"行动= QUOT; myPage.php" onsubmit =" return ddmmyy()">
其中myPage.php是一个页面,它会将位置标题返回到
的正确位置,如果JS被禁用。
日:< input type =" text"名称= QUOT峰; dd"大小= QUOT; 2英寸;> & nbsp;
月份:< input type =" text"命名= QUOT;毫米"大小= QUOT; 2英寸;> & nbsp;
年份:< input type =" text"名称= QUOT; YY"大小= QUOT; 4英寸;> & nbsp;
< input type =" button"值= QUOT确定];的onclick = QUOT; DDMMYY()">
< input type =" submit" value =" OK">
< / form>
< / body>
< / html>
var dd=document.forms[''myForm''].elements[''dd''].value;
var mm = document.getElementById("mm").value;
var mm=document.forms[''myForm''].elements[''mm''].value;
var yy = document.getElementById("yy").value;
var yy=document.forms[''myForm''].elements[''yy''].value;
Picking up elements via the name attribute while using getElementByID is
an IE-ism that should be avoided. And, the forms collection is more
widely supported.
var zz = yy + mm + dd;
location.href = zz + ".htm";
document.location.href = "http://" + yy + mm + dd + ".htm";
return false;
}
</script>
</head>
<body>
<form>
<form name="myForm" action="myPage.php" onsubmit="return ddmmyy()">
Where myPage.php is a page that will return a Location Header to the
proper location, in the event JS is disabled.
Day: <input type="text" name="dd" size="2">
Month: <input type="text" name="mm" size="2">
Year:<input type="text" name="yy" size="4">
<input type="button" value="OK" onclick="ddmmyy()">
<input type="submit" value="OK">
</form>
</body>
</html>
-
兰迪
comp.lang.javascript常见问题 - http://jibbering.com/faq
感谢那些家伙,我如何制作php页面?我绝对不知道
。
" Randy Webb" <您好************ @ aol.com>在消息中写道
news:8O ******************** @ comcast.com ...
Thanks for that guys, how do I make the php page? I have absolutely no idea
about that.
"Randy Webb" <Hi************@aol.com> wrote in message
news:8O********************@comcast.com...
McKirahan写道:
McKirahan wrote:
" WindAndWaves" <交流**** @ ngaru.com>在消息中写道
新闻:oT ******************* @ news.xtra.co.nz ...
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:oT*******************@news.xtra.co.nz...
嗨大师
我想做的是设置一个小形式,人们可以将
放入
Hi Gurus
What I would like to do is to setup a little form where people can put in
a
a
日期(例如日:[....]月..... [....]年[......],其中...是
date (e.g. Day: [....] Month..... [....] Year [......], where ... is
userinput)然后,将它们带到一个锚点(< A
NAME = {date}> ;< / A>),与他们选择的日期有关。你可能
userinput) and subsequently, will take them through to an anchor (<A
NAME={date}></A>), relating to the date that they selected. As you may
have
现在已经解决了,在java脚本方面我是一个真正的新手。
<我有一个使用谷歌浏览,但到目前为止没有运气
如果你能帮忙请告诉我
Nicolaas
worked out by now, I am a real novice when it comes to java script.
I have a browse using Google, but so far no luck
Let me know if you can help
Cheers
Nicolaas
而不是链接,只是去页面怎么样?
这会让你开始吗?注意自动换行。
< html>
< head>
< title> datelink.htm< / title>
< script type = " text / javascript">
函数ddmmyy(){
var dd = document.getElementById(" dd")。value;
Instead of a link, how about just going to the page?
Will this get you started? Watch for word-wrap.
<html>
<head>
<title>datelink.htm</title>
<script type="text/javascript">
function ddmmyy() {
var dd = document.getElementById("dd").value;
var dd = document.forms [''myForm'']。elements [''dd'']。value;
var dd=document.forms[''myForm''].elements[''dd''].value;
var mm = document.getElementById(" mm")。value;
var mm = document.getElementById("mm").value;
var mm = document.forms [''myForm'']。elements [''mm'']。value;
var mm=document.forms[''myForm''].elements[''mm''].value;
var yy = document.getElementById(" yy")。value;
var yy = document.getElementById("yy").value;
var yy = document.forms [''myForm'']。elements [''yy'']。value ;
使用getElementByID时通过name属性拾取元素是一个应该避免的IE主义。并且,表单集合得到了更广泛的支持。
var yy=document.forms[''myForm''].elements[''yy''].value;
Picking up elements via the name attribute while using getElementByID is
an IE-ism that should be avoided. And, the forms collection is more
widely supported.
var zz = yy + mm + dd;
location.href = zz +" .htm" ;
var zz = yy + mm + dd;
location.href = zz + ".htm";
document.location.href =" http://" + yy + mm + dd +" .htm" ;;
返回false;
document.location.href = "http://" + yy + mm + dd + ".htm";
return false;
}
< / script>
< / head> ;
< body>
< form>
}
</script>
</head>
<body>
<form>
< form name =" myForm"行动= QUOT; myPage.php" onsubmit =" return ddmmyy()">
其中myPage.php是一个页面,如果JS被禁用,它会将位置标题返回到正确的位置。
<form name="myForm" action="myPage.php" onsubmit="return ddmmyy()">
Where myPage.php is a page that will return a Location Header to the
proper location, in the event JS is disabled.
日:< input type =" text"名称= QUOT峰; dd"大小= QUOT; 2英寸;> & nbsp;
月份:< input type =" text"命名= QUOT;毫米"大小= QUOT; 2英寸;> & nbsp;
年份:< input type =" text"名称= QUOT; YY"大小= QUOT; 4英寸;> & nbsp;
< input type =" button"值= QUOT确定]; onclick =" ddmmyy()">
Day: <input type="text" name="dd" size="2">
Month: <input type="text" name="mm" size="2">
Year:<input type="text" name="yy" size="4">
<input type="button" value="OK" onclick="ddmmyy()">
< input type =" submit" value =" OK">
<input type="submit" value="OK">
< / form>
< / body>
< / html>
</form>
</body>
</html>
>
-
Randy
comp.lang.javascript常见问题 - http ://jibbering.com/faq
这篇关于使用用户字段创建链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!