dousou2897 2014-06-20 09:53
浏览 129
已采纳

在php中动态更改文本

hey guys i am building a form in which i want when a user select an option from the dropdown menus a text to be displayed and calculate the price.

The dropdown menu is:

<select id="recipient" name="recipient" tabindex="6" class="selmenu">  
            <option value="staff">Site Staff</option>  
            <option value="editor">Editor-in-Chief</option>  
            <option value="technical">Tech Department</option>  
            <option value="pr">Public Relations</option>  
            <option value="support">General Support</option>  
        </select>

and the other dropdown menu is:

<select id="recipient" name="recipient" tabindex="6" class="selmenu">  
            <option value="one">1</option>  
            <option value="two">2</option>  
            <option value="three">3</option>  
            <option value="four">4</option>  
            <option value="five">5</option>  
        </select>

What i want to do is when the user selects something from the first and the second menu i want a textfield to change dynamically... can anyone point me the way?

  • 写回答

2条回答 默认 最新

  • du4629 2014-06-20 09:58
    关注

    only ajax/jquery could do that in combination of php step might be...

    1. onchange of any dropdown make a ajax request to php script.

    2. return the json response from php script

    3. use this response to either manipulate your form or display data on page.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据