Maybe it is something to do with my actual function.
Would you mind sharing with me a working example? (pm me if you want)l.
I have even tried replicating GT's editor code, and this still does not work:
sub tableeditor {
# -------------------------------------------------------------------
# My own table editor ;-)
#
#
print $IN->header();
#
print qq~
<script language="Javascript">
<!--
var field_clear = 1;
function setid (myform) {
var opts = 'do';
var action = myform.todo.options[myform.todo.selectedIndex].value;
var table = myform.db.options[myform.db.selectedIndex].text;
var key = myform.keyid.value;
if (key == 'id') {
key = '';
}
if (action == 'search_results') {
myform[opts].value = 'search_results';
myform.keyword.value = '*';
myform.ID.value = '';
myform.Username.value = '';
}
else if ((action == 'modify_search_form') && key) {
myform[opts].value = 'modify_search_results';
myform.keyword.value = '';
if (table == 'Users') {
myform.Username.value = key;
myform.ID.value = '';
}
else {
myform.Username.value = '';
myform.ID.value = key;
}
}
else if ((action == 'delete_search_form') && key) {
myform[opts].value = 'delete_search_results';
myform.keyword.value = '';
if (table == 'Users') {
myform.Username.value = key;
myform.ID.value = '';
}
else {
myform.Username.value = '';
myform.ID.value = key;
}
}
else if ((action == 'search_form') && key) {
myform[opts].value = 'search_results';
myform.keyword.value = '';
if (table == 'Users') {
myform.Username.value = key;
myform.ID.value = '';
}
else {
myform.Username.value = '';
myform.ID.value = key;
}
}
else {
myform[opts].value = action;
myform.keyword.value = '';
myform.ID.value = '';
myform.Username.value ='';
}
myform.keyid.value = '';
}
// -->
</script>
<form method="GET" action="admin.cgi" onSubmit="setid(this)" name="searchform" target="content">
<input type="hidden" name="keyword" value="">
<input type="hidden" name="Username" value="">
<input type="hidden" name="ID" value="">
<input type="hidden" name="do" value="">
<input type="hidden" name="ID-opt" value="=">
<input type="hidden" name="Username-opt" value="=">
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#DDDDDD"><font face="Tahoma,Arial,Helvetica" size="2"> Editor</font></td>
</tr>
<tr>
<td><br>
<select size="1" name="db">
<option>EditorDetails</option>
</select><br>
<select size="1" name="todo">
<option value="add_form">Add</option>
<option value="modify_search_form">Modify</option>
<option value="delete_search_form">Delete</option>
<option value="search_form">Search</option>
<option value="search_results">List All</option>
<option value="editor_table_form">Properties</option>
</select><br>
<nobr><input type=text name="keyid" value="id" onFocus="if (field_clear) { searchform.keyid.value=''; field_clear = 0; }" size=5> <input type="submit" value="Go"> <font face="Tahoma,Arial,Helvetica" size="2"></font></nobr>
<font face="Tahoma,Arial,Helvetica" size="2">
<br>
</font></td>
</tr>
</table>
</form>
~;
}
http://www.iuni.com/...tware/web/index.html
Links Plugins
Would you mind sharing with me a working example? (pm me if you want)l.
I have even tried replicating GT's editor code, and this still does not work:
Code:
sub tableeditor {
# -------------------------------------------------------------------
# My own table editor ;-)
#
#
print $IN->header();
#
print qq~
<script language="Javascript">
<!--
var field_clear = 1;
function setid (myform) {
var opts = 'do';
var action = myform.todo.options[myform.todo.selectedIndex].value;
var table = myform.db.options[myform.db.selectedIndex].text;
var key = myform.keyid.value;
if (key == 'id') {
key = '';
}
if (action == 'search_results') {
myform[opts].value = 'search_results';
myform.keyword.value = '*';
myform.ID.value = '';
myform.Username.value = '';
}
else if ((action == 'modify_search_form') && key) {
myform[opts].value = 'modify_search_results';
myform.keyword.value = '';
if (table == 'Users') {
myform.Username.value = key;
myform.ID.value = '';
}
else {
myform.Username.value = '';
myform.ID.value = key;
}
}
else if ((action == 'delete_search_form') && key) {
myform[opts].value = 'delete_search_results';
myform.keyword.value = '';
if (table == 'Users') {
myform.Username.value = key;
myform.ID.value = '';
}
else {
myform.Username.value = '';
myform.ID.value = key;
}
}
else if ((action == 'search_form') && key) {
myform[opts].value = 'search_results';
myform.keyword.value = '';
if (table == 'Users') {
myform.Username.value = key;
myform.ID.value = '';
}
else {
myform.Username.value = '';
myform.ID.value = key;
}
}
else {
myform[opts].value = action;
myform.keyword.value = '';
myform.ID.value = '';
myform.Username.value ='';
}
myform.keyid.value = '';
}
// -->
</script>
<form method="GET" action="admin.cgi" onSubmit="setid(this)" name="searchform" target="content">
<input type="hidden" name="keyword" value="">
<input type="hidden" name="Username" value="">
<input type="hidden" name="ID" value="">
<input type="hidden" name="do" value="">
<input type="hidden" name="ID-opt" value="=">
<input type="hidden" name="Username-opt" value="=">
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#DDDDDD"><font face="Tahoma,Arial,Helvetica" size="2"> Editor</font></td>
</tr>
<tr>
<td><br>
<select size="1" name="db">
<option>EditorDetails</option>
</select><br>
<select size="1" name="todo">
<option value="add_form">Add</option>
<option value="modify_search_form">Modify</option>
<option value="delete_search_form">Delete</option>
<option value="search_form">Search</option>
<option value="search_results">List All</option>
<option value="editor_table_form">Properties</option>
</select><br>
<nobr><input type=text name="keyid" value="id" onFocus="if (field_clear) { searchform.keyid.value=''; field_clear = 0; }" size=5> <input type="submit" value="Go"> <font face="Tahoma,Arial,Helvetica" size="2"></font></nobr>
<font face="Tahoma,Arial,Helvetica" size="2">
<br>
</font></td>
</tr>
</table>
</form>
~;
}
http://www.iuni.com/...tware/web/index.html
Links Plugins