Skip to content

Instantly share code, notes, and snippets.

@cjk
Created August 4, 2010 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjk/507902 to your computer and use it in GitHub Desktop.
Save cjk/507902 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Form-Test</title>
<script type="text/javascript" src="file://public/javascripts/right-min.js"></script>
<script type="text/javascript">
document.onReady(function() {
var myform = "<form method='get' id='globalSearchForm' class='searchform' action='/globalsearch/search'><fieldset><div class='form_row'><span id='modeltype_selector_container'><input type='radio' value='all' name='search[modeltype]' id='search_modeltype_all' class='obj_type_select compact' checked=''>Alle<input type='radio' value='operations' name='search[modeltype]' id='search_modeltype_operations' class='obj_type_select compact' >Arbeitspositionen<input type='radio' value='record_titles' name='search[modeltype]' id='search_modeltype_record_titles' class='obj_type_select compact' >Ordnungstitel<input type='radio' value='damage_parts' name='search[modeltype]' id='search_modeltype_ssl' class='obj_type_select compact' >FO</span><label for='search_division_id'>Sparte:</label><span id='division_selector_container'><select name='search[division_id]' id='search_division_id' classes='division_selectbox updates_subgrp_select' ><option selected='selected' value=''>-</option></select></span><label for='search_group_code'>Gruppe:</label><span id='group_selector_container'><span id='group_select' classes='' ><select name='search[group_code]' id='search_group_code' classes='group_selectbox by_code updates_subgrp_select' ></select></span></span><label for='search_subgroup_code'>Untergruppe:</label><span id='subgroup_selector_container'><span id='subgroup_select' select_tag_name='search[subgroup_id]' classes='' ><select name='search[subgroup_id]' id='search_subgroup_id' classes='subgroup_selectbox' ></select></span></span></div><div class='form_row'><label for='search_infotype'>Infoart:</label><span id='infotype_selector_container'><select name='search[infotype]' id='search_infotype' classes='infotype_selectbox' ></select></span><span id='titlenumber_selector_container'><label>Titelnummer:<input name='search[code]' id='search_code' type='text' size='4' classes='' ></input></label></span><span id='searchtext_selector_container'><label>Suchtext:<input name='search[text]' id='search_text' type='text' classes='' ></input></label></span><label for='search_state'>Status:</label><span id='state_selector_container'><select name='search[state]' id='search_state' classes='state_selectbox' ></select></span><label for='search_created_by'>Ersteller:</label><span id='creator_selector_container'><select name='search[created_by]' id='search_created_by' classes='creator_selectbox' ></select></span></div><div class='form_row last'><input type='submit' value='Search' name='commit' id='globalSearchSubmit'><input type='reset' value='reset' name='reset' id='globalSearchReset'><label for='search_sort_by'>Sortierung:<select name='search[sort_by]' id='search_sort_by' class='sorting_selectbox'><option value='default'>Relevanz</option><option value='code'>Nummer</option><option value='updated_at' selected='selected'>Änderungsdatum</option><option value='group_code'>KG/FG</option></select></label></div></fieldset></form>"
var formContainer = $E('div', {id: 'searchform'}).update(myform);
var globalSearchFrm = $$('#globalsearch').first().insert(formContainer);
$('globalSearchSubmit').on({
click: function(event) {
var target = event.target;
event.preventDefault();
alert($(target.form).serialize());
return false;
}
});
// THIS CODE BLOCK TRIGGERS THE BUG IN IE6, REMOVE IT AND ALL WORKS FINE:
var searchform = $('searchform');
if (searchform) {
var search_submit_btn = searchform.select("input[type='submit']")[0];
}
alert("OK, now press the Search-button and watch that in IE6 the modeltype-input won't get parametrized.");
}); // end of document#ready
</script>
</head>
<body>
<div id='container'>
<div id='globalsearch'>
</div>
<div id="searchresults">
<div class="pagination">
</div>
<table id="selectable">
</table>
<div class="pagination">
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment