Forums de discussion

Replacing & with & in liferay search form action

Kamal Kant Pandey, modifié il y a 8 années.

Replacing & with & in liferay search form action

New Member Publications: 17 Date d'inscription: 24/10/14 Publications récentes
Hi All,

I have implemented the liferay search and due to which I am getting errors when validating through "https://validator.w3.org/".
I have resolved most of the errors but it is still getting errors to replace & with & .
What I need to do to resolve the above errors in the form action only?

[b]The form of the search is as follows:
 <form action="some website/home;jsessionid=847179AC563BFEFE9F3C1F90D908A7BD.node2?p_p_id=3&amp;p_p_lifecycle=0&amp;p_p_state=maximized&amp;p_p_mode=view&amp;p_p_col_pos=2&amp;p_p_col_count=11&amp;_3_struts_action=%2Fsearch%2Fsearch&amp;_3_redirect=%2F" method="get" name="_3_fm" onSubmit="_3_search(); return false;"> <input name="p_p_id" type="hidden" value="3"><input name="p_p_lifecycle" type="hidden" value="0"><input name="p_p_state" type="hidden" value="maximized"><input name="p_p_mode" type="hidden" value="view"><input name="p_p_col_pos" type="hidden" value="2"><input name="p_p_col_count" type="hidden" value="11"><input name="_3_struts_action" type="hidden" value="/search/search"><input name="_3_redirect" type="hidden" value="/"> <span class="aui-field aui-field-text aui-field-inline tftextinput"> <span class="aui-field-content"> <span class="aui-field-element "> <input class="aui-field-input aui-field-input-text" id="keywords" name="keywords" title="Search Web Content" type="text" value="Content Search..." onBlur="if (this.value == '') { this.value = '\u0043\u006f\u006e\u0074\u0065\u006e\u0074\u0020\u0053\u0065\u0061\u0072\u0063\u0068\u002e\u002e\u002e'; }" onFocus="if (this.value == '\u0043\u006f\u006e\u0074\u0065\u006e\u0074\u0020\u0053\u0065\u0061\u0072\u0063\u0068\u002e\u002e\u002e') { this.value = ''; }" size="20"> </span> </span> </span> <input id="imagesearch" style="vertical-align:middle;" alt="Search" src="/theme/images/common/search.png" title="Search" type="image"> </form>[/b]


Please suggest how i can do this?
thumbnail
Himanshu Bhandari, modifié il y a 8 années.

RE: Replacing & with &amp; in liferay search form action

Regular Member Publications: 148 Date d'inscription: 09/05/14 Publications récentes
Hi
Can you explain what are you trying to do? At least I am unable to understand.
Thanks.
Kamal Kant Pandey, modifié il y a 8 années.

RE: Replacing & with &amp; in liferay search form action

New Member Publications: 17 Date d'inscription: 24/10/14 Publications récentes
Hi Himanshu,

I am trying to replace the url created by action of the search portlet which I have implemented through hook so as to pass the w3 validator checking of the generated html page.

The new issue which has popped up is that I have done the same using javascript in the hook itself.
The form is something like this.



Here is the javascript which I have written.

windows.onload = function() {
    	document.&lt;%= namespace %&gt;fm.action= get_action();
	}
	function get_action() {
		var pUrl = portletURL.toString();
		pUrl = pUrl.replace('&amp;','&amp;');
		return pUrl;
	}


But,this has made the options button(through which we set the look and feel,configuration) of any webcontent and portlets as non clickable.

Please suggest any way to complete this.

Regards,
Kamal