Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何更改jQuery输入的显示位置_Javascript_Php_Jquery_Html_Css - Fatal编程技术网

Javascript 如何更改jQuery输入的显示位置

Javascript 如何更改jQuery输入的显示位置,javascript,php,jquery,html,css,Javascript,Php,Jquery,Html,Css,问题是: 当您在输入表单后按submit时,我会将下面输入框中显示的值显示在一个单独的div中 例如: 函数sunsign(){ document.form1.date.selectedIndex; document.form1.month.selectedIndex; document.form1.sign.value; 如果(document.form1.month.selectedIndex==1&&document.form1.date.selectedIndex=20){documen

问题是:

当您在输入表单后按submit时,我会将下面输入框中显示的值显示在一个单独的div中

例如:

函数sunsign(){
document.form1.date.selectedIndex;
document.form1.month.selectedIndex;
document.form1.sign.value;
如果(document.form1.month.selectedIndex==1&&document.form1.date.selectedIndex=20){document.form1.sign.value=“Aquarius”}
如果(document.form1.month.selectedIndex==2&&document.form1.date.selectedIndex=19){document.form1.sign.value=“双鱼座”}
如果(document.form1.month.selectedIndex==3&&document.form1.date.selectedIndex=21){document.form1.sign.value=“Aries”;}
如果(document.form1.month.selectedIndex==4&&document.form1.date.selectedIndex=21){document.form1.sign.value=“Taurus”}
如果(document.form1.month.selectedIndex==5&&document.form1.date.selectedIndex=21){document.form1.sign.value=“Gemini”}
如果(document.form1.month.selectedIndex==6&&document.form1.date.selectedIndex=21){document.form1.sign.value=“Cancer”;}
如果(document.form1.month.selectedIndex==7&&document.form1.date.selectedIndex=22){document.form1.sign.value=“Leo”}
如果(document.form1.month.selectedIndex==8&&document.form1.date.selectedIndex=22){document.form1.sign.value=“Virgo”}
如果(document.form1.month.selectedIndex==9&&document.form1.date.selectedIndex=22){document.form1.sign.value=“Libra”}
如果(document.form1.month.selectedIndex==10&&document.form1.date.selectedIndex=22){document.form1.sign.value=“Scorpio”}
如果(document.form1.month.selectedIndex==11&&document.form1.date.selectedIndex=22){document.form1.sign.value=“人马座”}
如果(document.form1.month.selectedIndex==12&&document.form1.date.selectedIndex=21){document.form1.sign.value=“摩羯座”}
如果(document.form1.month.selectedIndex==“x”| | document.form1.date.selectedIndex==“y”)返回;
}


月
日期
: 
太阳信号
月
一月
二月
前进
四月
也许
六月
七月
八月
九月
十月
十一月
十二月
白天
1.
2.
3.
4.
5.
6.
7.
8.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
我有这个错误:

GET http://trulydesigns.com/horoscope/assets/js/horoscope.js 404 (Not Found)
现在确定在html中添加一个div(您希望在其中显示结果):


因此,您替换了将结果放入输入中的行,而将其放入div中。

@depperm fixed,不确定如何执行。
<form style="padding-top:150px" name="form1">
    <table border="0" bgcolor="c0c0c0" cellspacing="0" cellpadding="1">
        <tr>
            <td>
                <font size="1" face="verdana, arial, helvetica, sans-serif"><b>&nbsp;Month&nbsp;</b></font>
            </td>
            <td>
                <font size="1" face="verdana, arial, helvetica, sans-serif"><b>&nbsp;Date&nbsp;</b></font>
            </td>
            <td rowspan="2">
                <font size="3" face="verdana, arial, helvetica, sans-serif"><b>&nbsp;&nbsp;<b>:</b>&nbsp;</b></font>
            </td>
            <td>
                <font size="1" face="verdana, arial, helvetica, sans-serif"><b>&nbsp;Sunsign&nbsp;</b></font>
            </td>
        </tr>

        <tr>
            <td>
                <select name="month">
                    <option value="x" selected>Month</option>
                    <option value="1">January</option>
                    <option value="2">February</option>
                    <option value="3">March</option>
                    <option value="4">April</option>
                    <option value="5">May</option>
                    <option value="6">June</option>
                    <option value="7">July</option>
                    <option value="8">August</option>
                    <option value="9">September</option>
                    <option value="10">October</option>
                    <option value="11">November</option>
                    <option value="12">December</option>
                </select>
            </td>

            <td>
                <select name="date" onChange="validate()">
                    <option value="y" selected>Day</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                    <option value="15">15</option>
                    <option value="16">16</option>
                    <option value="17">17</option>
                    <option value="18">18</option>
                    <option value="19">19</option>
                    <option value="20">20</option>
                    <option value="21">21</option>
                    <option value="22">22</option>
                    <option value="23">23</option>
                    <option value="24">24</option>
                    <option value="25">25</option>
                    <option value="26">26</option>
                    <option value="27">27</option>
                    <option value="28">28</option>
                    <option value="29">29</option>
                    <option value="30">30</option>
                    <option value="31">31</option>
                </select>
            </td>

            <td>
                <input name="sign" size="12" value="??" />&nbsp;<input type="button" value="submit" onClick="sunsign()">
            </td>
        </tr>
    </table>
</form>
GET http://trulydesigns.com/horoscope/assets/js/horoscope.js 404 (Not Found)
<div id="result"></div>
document.form1.sign.value
document.getElementById('result').innerHTML