提问人:Sri 提问时间:10/9/2012 最后编辑:Sri 更新时间:10/18/2012 访问量:109
在 JavaScript 中一次又一次地添加价值
adding value again and again in javascript
问:
在我的 JavaScript 中,我有三个.是否打开取决于所选内容。一切正常。但是选择后,如果我想更改,仍然会打开旧的。如果我想更改 ,所有都应该更改并按照Links
second link
first link id
second link
first link
second link
id
first link
fields
first link.
var generic_lookup_Enr_Rds_Section2009_selected = function(id, to_s) {
var question_link = $('#question_picker').attr('href');
question_link = question_link.replace(/\?+$/, '');
question_link = question_link + '?columns[enr_rds_section_id]=' + id;
$('#question_picker').attr('href', question_link);
$("#modal_popup").dialog("destroy");
};
var generic_lookup_Enr_Rds_Question2009_selected = function(id, to_s) {
var answer_link = $('#answer_picker').attr('href');
answer_link = answer_link.replace(/\?+$/, '');
answer_link = answer_link + '?columns[enr_rds_question_id]=' + id;
$('#answer_picker').attr('href', answer_link);
$("#modal_popup").dialog("destroy");
};
[HTML全文]
<div class="question">
<%= f.label :Section %>
<%= link_to pro_generic_lookup_data_path("Enr::Rds::Section2009", format: :js), data: {remote: true} do %>
<%= image_tag("Search-icon.gif", border: 0, :alt => "Look up Sections", title: 'Lookup Sections') %>
<% end %>
</div>
<div class="question">
<%= f.label :Question %>
<%= link_to pro_generic_lookup_data_path("Enr::Rds::Question2009", format: :js), data: {remote: true}, id: "question_picker" do %>
<%= image_tag("Search-icon.gif", border: 0, :alt => "Look up Questions", title: 'Lookup Questions', :class => "image_section_search") %>
<% end %>
</div>
答:
0赞
Sri
10/18/2012
#1
通过Javascript使用级联下拉函数为例解决了它。谢谢大家。
评论
<select>