soulman2000
|
| Posted: 08/02/2002, 3:52 AM |
|
Hi everybody
I am using CC2(asp w templ.) and I am using a typical search-list-detail logic.
After typing in the search keywords I am jumping to the list page.
BUT within the search form field I am checking the 'required' checkbox for the spezific search-field, which somehow doesn't do the require-check :/
If I am looking at the sourcecode within the search-page, CC simply creates a [form]code (type:search) and links via form-action to the list page; unfortunately no checking is done if the required field has some text in it or not ( ... I thing the required-checkbox doesn't effect the search-type?!
On the other side, if I am using a record-type instead of a search-type in the form, the asp-page is calling itself, checks the required fields, and depending on the action "cancel,delete,update,or insert" the program is doing its job and is redirecting after that to the new page.
Should'nt this kind of logic also be done for a search-type ... calling itself, checking the required fields, and redirecting to the new page (this time w/o any "cancel, delete, update, or insert" job.
Do I miss something here, or is there a smart way to get the required fields checked within a search-type form?!
Thanks a lot!
|
|
|
 |
Nicole
|
| Posted: 08/05/2002, 5:23 AM |
|
Hello,
in case you mark field as 'Required' it doesn't mean that some code for checking field content will be generated. To verify if the field was filled you should add some custom JavaScript function assigned to the form onsubmit event. Place the code like below to the Search form Footer section:
<script language = "JavaScript">
document.Search_form_name.onsubmit = myfunc;
function myfunc(){
if (document.Search_form_name.field_name.value.length == 0)
{
return false;
}
}
</script>
|
|
|
 |
|