开发者

Insert data in a form inputbox with jquery

In my main page, I have a div showing some external html content. Here I have some radio buttons. When the user select a radio, the form of the parent page shound be updated.

The extern开发者_Python百科al code is like this:

function updateForm(val){
  $('#photourl', window.parent.document.frm).val(val).change();
};
...
<input name="photo" id="photo" value="someVal" onclick="updateForm(this.value)" type="radio">

It works fine in firefox, opera, flock, msie. It does not work at all in chrome and safari.

Anybody can help me? Thanks


the second argument in $('#photourl', window.parent.document.frm) is acquired with a nonstandard technique. try $('#photourl', $('#frm', window.parent.document)[0]), or, because it's all in one document really (per your comments), just get rid of it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜