dqf2015 2010-11-16 09:00
浏览 11
已采纳

当用户在表单框中输入代码时,动态创建链接

I have a form....

<form id="orderform" method="post" orderform="" name="">
  <table width="533" cellspacing="0" cellpadding="2" border="0" id="ordertable">
  <tbody>
    <tr>
      <td>Product Code</td>
      <td>Meterage</td>
      <td>Sample Img</td>
    </tr>
    <tr class="item">
      <td class="prodcode">
        <input type="text" id="prodcode" name="prodcode">
      </td>
      <td class="meterage">
        <input type="text" id="meterage" name="meterage">
      </td>
      <td class="imgsample"></td>
    </tr>
    </tbody>
  </table>
</form>

What i would like is when a user clicks out of the box on the prodcode it searches a folder for the image reference...creates a link on under the imgsample header for that particular item using the prodCode they entered...

http://www.mylink.com/images/folder/sub-folder/imageref.jpg

Is this an impossible task, any ideas?

  • 写回答

3条回答 默认 最新

  • dongtiannai0654 2010-11-16 09:12
    关注

    I hope this is what you are asking for.

    $("#prodcode").blur(function() {
      $.post(
             'yourpage.php', //this page reads the image code and gives you the image location
             { action: 'searchimage', imgreference: $('#prodcode').val() },
             function(data) { 
                 //export the link as data            
                 $("td.imgsample").html('<img src="'+data+'"/>');
             }
            );
    });
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应