Cheer 发表于 2007-4-28 10:54:03

测试搜索问卷调查脚本

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
要完成此效果需要两个步骤

第一步:把如下代码加入到<head>区域中

<script language=javascript>

function processform(form){

var xf=xf1=0;

hc=new array(20);

var roll_call=hc.length;

for (i=roll_call;i>0;i--)

{hc=1};

//loops through the radio buttons finding out which one is selected

if (form.c1.checked==1) hc=2;

if (form.c1.checked==1) hc=3;

if (form.c1.checked==1) hc=4;

if (form.c2.checked==1) hc=2;

if (form.c2.checked==1) hc=3;

if (form.c2.checked==1) hc=4;

if (form.c3.checked==1) hc=2;

if (form.c3.checked==1) hc=3;

if (form.c3.checked==1) hc=4;

if (form.c4.checked==1) hc=2;

if (form.c4.checked==1) hc=3;

if (form.c4.checked==1) hc=4;

if (form.c5.checked==1) hc=4;

if (form.c5.checked==1) hc=3;

if (form.c5.checked==1) hc=2;

if (form.c6.checked==1) hc=2;

if (form.c6.checked==1) hc=3;

if (form.c6.checked==1) hc=4;

if (form.c7.checked==1) hc=2;

if (form.c7.checked==1) hc=3;

if (form.c7.checked==1) hc=4;

if (form.c8.checked==1) hc=2;

if (form.c8.checked==1) hc=3;

if (form.c8.checked==1) hc=4;

if (form.c9.checked==1) hc=4;

if (form.c9.checked==1) hc=3;

if (form.c9.checked==1) hc=2;

if (form.c10.checked==1) hc=2;

if (form.c10.checked==1) hc=3;

if (form.c10.checked==1) hc=4;

if (form.c11.checked==1) hc=2;

if (form.c11.checked==1) hc=3;

if (form.c11.checked==1) hc=4;

if (form.c12.checked==1) hc=2;

if (form.c12.checked==1) hc=3;

if (form.c12.checked==1) hc=4;

if (form.c13.checked==1) hc=4;

if (form.c13.checked==1) hc=3;

if (form.c13.checked==1) hc=2;

if (form.c14.checked==1) hc=2;

if (form.c14.checked==1) hc=3;

if (form.c14.checked==1) hc=4;

if (form.c15.checked==1) hc=2;

if (form.c15.checked==1) hc=3;

if (form.c15.checked==1) hc=4;

if (form.c16.checked==1) hc=2;

if (form.c16.checked==1) hc=3;

if (form.c16.checked==1) hc=4;

if (form.c17.checked==1) hc=4;

if (form.c17.checked==1) hc=3;

if (form.c17.checked==1) hc=2;

if (form.c18.checked==1) hc=2;

if (form.c18.checked==1) hc=3;

if (form.c18.checked==1) hc=4;

if (form.c19.checked==1) hc=4;

if (form.c19.checked==1) hc=3;

if (form.c19.checked==1) hc=2;

if (form.c20.checked==1) hc=2;

if (form.c20.checked==1) hc=3;

if (form.c20.checked==1) hc=4;

for (i=roll_call;i>0;i--)

{xf+=hc};   

xf1=math.ceil(xf*1.25);

form.answer.value="你的得分为"+xf1+"分";

}</script>


第二步:把如下代码加入到<body>区域中

<table border=0 cellpadding=4 cellspacing=0 height=79 width=500>

<tbody>

<tr>

    <td align=middle height=46 width=519><span

      style="font-family: 宋体; font-size: 6pt">◇◆◇◆◇</span><font

      color=#0000ff><strong><span

      style="font-family: 宋体; font-size: 12pt; line-height: 15px">你有焦虑情绪吗?</span></strong></font><span

      style="font-family: 宋体; font-size: 6pt">◇◆◇◆◇</span></td></tr>

<tr>

    <td height=18 width=519><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">仔细阅读每一题,然后根据你最近一个星期的实际感觉,选择适合的答案。</span></td></tr></tbody></table></div>

<form name=see>

<div align=left>

<table border=0 cellpadding=10 cellspacing=0 height=388 width=517>

<tbody>

<tr>

    <td height=1 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">1、觉得比平常容易紧张和着急。<br><input

      name=c1 type=radio value=1>没有或很少时间。<br><input name=c1 type=radio

      value=3>小部分时间。<br><input name=c1 type=radio value=5>相当多时间。<br><input

      name=c1 type=radio value=v1>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=1 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">2、无缘无故感到害怕。<br><input

      name=c2 type=radio value=11>没有或很少时间。<br><input name=c2 type=radio

      value=31>小部分时间。<br><input name=c2 type=radio value=51>相当多时间。<br><input

      name=c2 type=radio value=v2>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=1 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">3、容易心里烦乱或觉得惊慌。<br><input

      name=c3 type=radio value=12>没有或很少时间。<br><input name=c3 type=radio

      value=32>小部分时间。<br><input name=c3 type=radio value=52>相当多时间。<br><input

      name=c3 type=radio value=v3>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">4、觉得可能将要发疯。<br><input

      name=c4 type=radio value=13>没有或很少时间。<br><input name=c4 type=radio

      value=33>小部分时间。<br><input name=c4 type=radio value=53>相当多时间。<br><input

      name=c4 type=radio value=v4>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">5、觉得一切都很好,也不会发生什么不幸。<br><input

      name=c5 type=radio value=14>没有或很少时间。<br><input name=c5 type=radio

      value=34>小部分时间。<br><input name=c5 type=radio value=54>相当多时间。<br><input

      name=c5 type=radio value=v5>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">6、手脚发抖打颤。<br><input

      name=c6 type=radio value=15>没有或很少时间。<br><input name=c6 type=radio

      value=35>小部分时间。<br><input name=c6 type=radio value=55>相当多时间。<br><input

      name=c6 type=radio value=v6>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">7、因为头痛、头颈痛和背痛而苦恼。<br><input

      name=c7 type=radio value=16>没有或很少时间。<br><input name=c7 type=radio

      value=36>小部分时间。<br><input name=c7 type=radio value=56>相当多时间。<br><input

      name=c7 type=radio value=v7>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">8、感觉容易衰弱和疲乏。<br><input

      name=c8 type=radio value=17>没有或很少时间。<br><input name=c8 type=radio

      value=37>小部分时间。<br><input name=c8 type=radio value=57>相当多时间。<br><input

      name=c8 type=radio value=v8>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">9、觉得心平气和,并且容易安静地坐着。<br><input

      name=c9 type=radio value=18>没有或很少时间。<br><input name=c9 type=radio

      value=38>小部分时间。<br><input name=c9 type=radio value=58>相当多时间。<br><input

      name=c9 type=radio value=v9>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">10、觉得心跳得很快。<br><input

      name=c10 type=radio value=19>没有或很少时间。<br><input name=c10 type=radio

      value=39>小部分时间。<br><input name=c10 type=radio value=59>相当多时间。<br><input

      name=c10 type=radio value=v10>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">11、因为一阵阵头晕而苦恼。<br><input

      name=c11 type=radio value=110>没有或很少时间。<br><input name=c11 type=radio

      value=310>小部分时间。<br><input name=c11 type=radio value=510>相当多时间。<br><input

      name=c11 type=radio value=v11>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">12、有晕倒发作,或觉得要晕倒似的。<br><input

      name=c12 type=radio value=111>没有或很少时间。<br><input name=c12 type=radio

      value=311>小部分时间。<br><input name=c12 type=radio value=511>相当多时间。<br><input

      name=c12 type=radio value=v12>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">13、吸气呼气都感到很容易。<br><input

      name=c13 type=radio value=112>没有或很少时间。<br><input name=c13 type=radio

      value=312>小部分时间。<br><input name=c13 type=radio value=512>相当多时间。<br><input

      name=c13 type=radio value=v13></span><span

      style="font-family: 宋体; font-size: 9pt">绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">14、手脚麻木和刺痛。<br><input

      name=c14 type=radio value=113>没有或很少时间。<br><input name=c14 type=radio

      value=313>小部分时间。<br><input name=c14 type=radio value=513>相当多时间。<br><input

      name=c14 type=radio value=v14>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">15、因为胃痛和消化不良而苦恼。<br><input

      name=c15 type=radio value=114>没有或很少时间。<br><input name=c15 type=radio

      value=314>小部分时间。<br><input name=c15 type=radio value=514>相当多时间。<br><input

      name=c15 type=radio value=v15>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">16、常常要小便。<br><input

      name=c16 type=radio value=115>没有或很少时间。<br><input name=c16 type=radio

      value=315>小部分时间。<br><input name=c16 type=radio value=515>相当多时间。<br><input

      name=c16 type=radio value=v16>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">17、手常常是干燥温暖的。<br><input

      name=c17 type=radio value=116>没有或很少时间。<br><input name=c17 type=radio

      value=316>小部分时间。<br><input name=c17 type=radio value=516>相当多时间。<br><input

      name=c17 type=radio value=v17>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">18、脸红发热。<br><input

      name=c18 type=radio value=117>没有或很少时间。<br><input name=c18 type=radio

      value=317>小部分时间。<br><input name=c18 type=radio value=517>相当多时间。<br><input

      name=c18 type=radio value=v18>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">19、容易入睡并且一夜睡得很好。<br><input

      name=c19 type=radio value=118>没有或很少时间。<br><input name=c19 type=radio

      value=318>小部分时间。<br><input name=c19 type=radio value=518>相当多时间。<br><input

      name=c19 type=radio value=v19>绝大部分或全部时间。</span></td></tr>

<tr>

    <td height=35 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px">20、作恶梦。<br><input

      name=c20 type=radio value=119>没有或很少时间。<br><input name=c20 type=radio

      value=319>小部分时间。<br><input name=c20 type=radio value=519>相当多时间。<br><input

      name=c20 type=radio value=v20>绝大部分或全部时间。</span></td></tr>

<tr>

    <td align=middle height=25 width=517><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px"><input onclick=processform(this.form) style="font-family: 宋体; font-size: 9pt" type=button value=都选择完了,结果怎样?><input

      name=answer

      style="color: rgb(255,0,0); font-family: 宋体; font-size: 9pt"></span></td></tr></tbody></table></div></form>

<div align=left>

<table border=0 cellpadding=4 cellspacing=0 height=22 width=500>

<tbody>

<tr>

    <td height=22 width=520><span

      style="font-family: 宋体; font-size: 9pt; line-height: 15px"><font

      color=#ff0000>说明         

      </font>你焦虑评定的分界值是50分,分值越高,焦虑倾向越明显。</span></td></tr></tbody></table>
页: [1]
查看完整版本: 测试搜索问卷调查脚本