Value of input field in CP Search

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
jscholtysik

Value of input field in CP Search

Post by jscholtysik »

Hi all,

I use the snapshot dated 29.10.2007.

When I use the CP Search, the value of the input field is empty and there is no possibility to add a standard value for the search field like "Search". How can i achieve it or doesn't this possibility exist?

With the changed CP Search it isn't anymore possible to use a template... :-(


Joachim
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Post by flip-flop »

Hi Joachim,

please have a look into the docu, we have reworked the german part at this moment.

-> http://www.phpwcms.de/forum/viewtopic.php?p=94184#94184

Knut :D
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Post by Jensensen »

Hi Jo,

another JS based solution could be:

Code: Select all

<script type="text/javascript">
	var DefaultValue = 'Suche';						
	function clearSearch() {
	  if (document.mysearchform.search_input_field.value == DefaultValue) {
		document.mysearchform.search_input_field.value = '';
	  }
	}						
	function validateSearchHeader() {
		if ( document.mysearchform.search_input_field.value == '' || document.mysearchform.search_input_field.value.toLocaleLowerCase() == DefaultValue.toLocaleLowerCase() ) {
			alert('Bitte geben Sie mindestens einen Suchbegriff ein.');
			document.mysearchform.search_input_field.focus();
			return false;
		}
	  return true;
	}
</script>
<form name="mysearchform" id="mysearchform" action="/index.php?id=0,22,0,0,1,0" method="post" onsubmit="return validateSearchHeader()">
<input type="text" name="search_input_field" id="search_input_field" value="Suche" title="Sie können auch Platzhalterzeichen (*) verwenden." onfocus="if (this.value==DefaultValue) this.value='';" onblur="if (this.value=='') this.value=DefaultValue;" />
</form>
while:

<form name=........ action="/index.php?id=0,XY,0,0,1,0" ........

is your SEARCH Page

greetz
Jensensen
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
Post Reply