General search form with JQuery not working
Hi,
I tried to use jquery to submit a search form because I need some checking before submit. However, it did not go to search results page, but went to home page instead.
Here is my html:
<form name="catsearchform96767" id="generalSearchForm" method="post">
<p><label style="opacity: 1;" for="f-search">Search</label> <input type="text" name="CAT_Search" id="f-search" /> <button type="submit">GO</button></p>
</form>
Javascript:
$('#generalSearchForm').submit(function(){
$(this).attr('action', '/Default.aspx?SiteSearchID=1060&ID=/search-results');
$(this).unbind().submit();
return false;
It does not work with JQuery. But when I moved form action url from jquery to html, it worked. Any ideas? Cheers.
Hi David,
Below is the complete code I have used to load the current user to the people picker in SharePoint 2013.
$(document).ready(function(){
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', LoadCurrentUser);
function LoadCurrentUser() {
var context = SP.ClientContext.get_current();
var siteColl = context.get_site();
var web = siteColl.get_rootWeb();
this._currentUser = web.get_currentUser();
context.load(this._currentUser);
context.executeQueryAsync(Function.createDelegate(this, SetPickersToCurrentUser), Function.createDelegate(this, LoadUserfailed));
function LoadUserfailed() {
alert('failed');
function SetPickersToCurrentUser()
var loginName = this._currentUser.get_title();
SetPeoplePicker('Order Team', loginName);
function SetPeoplePicker(fieldName, userAccountName) {
var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + fieldName + "']");
var peoplePickerEditor = peoplePickerDiv.find("[title='" + fieldName + "']");
var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
peoplePickerEditor.val(userAccountName);
spPeoplePicker.AddUnresolvedUserFromEditor(true);
Let me know if you have any questions. I will help you out!
-Praveen.
ASP.NET and SharePoint developer
Blog: http://praveenbattula.blogspot.com
Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you.
Similar Messages
-
PHP email form with Validation - not working
Hello;
I am new to using php. I usually use coldfusion or asp but this site requires me to write in php. I have a form I am trying to get to work and right now.. it doesn't do anyhting but remember what you put in the fields. It doesn't want to send, and it won't execute the validation script for the fields that are required. Can anyone help me make this work? I'm confused and a definate newbie to PHP.
Here is my code:
<?php
$PHP_SELF = $_SERVER['PHP_SELF'];
$errName = "";
$errEmail = "";
$errPhone = "";
if(isset($_POST['submit'])) {
if($_POST["ac"]=="login"){
$FORMOK = TRUE; // $FORMOK acts as a flag. If you enter any of the conditionals below, // it gets set to FALSE, and the e-mail will not be sent.
// First Name
if(preg_match("/^[a-zA-Z -]+$/", $_POST["name"]) === 0) {
$errName = '<div class="errtext">Please enter you name.</div>';
$FORMOK = FALSE;
// Email
if(preg_match("/^[a-zA-Z]\w+(\.\w+)*\@\w+(\.[0-9a-zA-Z]+)*\.[a-zA-Z]{2,4}$/", $_POST["email"]) === 0) { $errEmail = '<div class="errtext">Please enter a valid email.</div>';
$FORMOK = FALSE;
// Phone
if(preg_match("/^[a-zA-Z -]+$/", $_POST["phone"]) === 0) {
$errPhone = '<div class="errtext">Please enter your phone number.</div>';
$FORMOK = FALSE;
if($FORMOK) {
$to = "[email protected]";
$subject = "my. - Contact Form";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$phone_field = $_POST['phone'];
$city_field = $_POST['city'];
$state_field = $_POST['state'];
$message = $_POST['comment'];
$message = "
Name: $name_field
Email: $email_field
Phone: $phone_field
City: $city_field
State: $state_field
Message: $message";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: <[email protected]>' . "\r\n";
$headers .= '[From] <$email_field>' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
header("Location: thankyou.php")
// I have no idea what these next 3 lines are for. You may just want to get rid of them.
ini_set("sendmail_from","[Send from]");
ini_set("SMTP","[mail server]");
mail($to, $subject, $message, $headers);
} else {
echo "Error!";
?>
<form method="post" action="<?php $PHP_SELF ?>" id="commentForm">
<input name="name" size="40" value="<?php echo $_POST["name"]; ?>" type="text">
<?php if(isset($errName)) echo $errName; ?>
<input name="email" size="40" value="<?php echo $_POST["email"]; ?>" type="text">
<?php if(isset($errEmail)) echo $errEmail; ?>
<input name="phone" size="40" value="<?php echo $_POST["phone"]; ?>" type="text" id="phone">
<?php if(isset($errPhone)) echo $errPhone; ?>
<input name="city" size="40" value="<?php echo $_POST["city"]; ?>" type="text" id="city">
<input name="state" size="40" value="<?php echo $_POST["state"]; ?>" type="text" id="state">
<textarea name="comment" cols="30" rows="10" id="comment"><?php echo $_POST["comment"]; ?></textarea>
<input type="submit" value="Submit" name="submit" class="contact-submit" />
</form>
It seems pretty simple.. but it's not working at all. I would also like this page to submit to it's self, and when it actually does send an email, to just make the form disappear and replace it with the thank you text instead of sending you to another page. I also do not need to use an smtp server, it goes directly to the network server when sent.
I'm really sorry to ask all of this, I'm trying to learn this language and need to make this work.
Thank you for anyones help in advance..oO(BarryGBrown)
> I have a php file which generates an email from a form
in a website I have
>designed. I just want to make some areas of the final
generated email in bold
>text. I know if people have plain text only selected in
their email client they
>won't see the bold text, but at least it will reach a
certain percentage of
>users.
You can't do bold text in a normal email. Plain text is just
that -
plain text. For anything more you need HTML. _If_ you should
need it.
Usually plain text serves pretty well and is the most
efficient way.
> the line in question is -
>
> $body ="Booking request details from website:\n\n";
>
> I have tried putting and ,
syntax is used in some forum software, but besides that it
has
no meaning whatsoever.
>inside the inverted commas, outside
>etc, plus tried different declarations within the
<head>, nothing works! What
>am I doing wrong?
You would have to create an entire HTML email with all the
required
headers and boundaries. Quite difficult to do by hand with
PHP's mail()
function.
> I am a beginner with this php stuff, please be kind!
Then you should start simple with plain text. There are some
classes out
there which make it easy to generate text and HTML emails
(phpmailer for
example), but you should be familiar with PHP coding if you
want to use
them.
Micha -
Sharepoint 2013 Setting people picker with Jquery not working in IE8
In a SharePoint 2013 list with a people picker column labeled Name the following code works great in IE9 and IE10, however in IE8 the script shows an undefined is null or not an object error message at spPeoplePicker.AddUnresolvedUserFromEditor(true);
FYI using jquery min 1.10.2
Any ideas on how to resolve the issue?
<script type="text/javascript">
$(document).ready(function () {
var userid = _spPageContextInfo.userId;
//alert(userid)
function GetCurrentUser() {
var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getuserbyid(" + userid + ")";
var requestHeaders = { "accept" : "application/json;odata=verbose" };
$.ajax({
url : requestUri,
contentType : "application/json;odata=verbose",
headers : requestHeaders,
success : onSuccess,
error : onError
function onSuccess(data, request){
var userName = data.d.Title;
//set following "field" as column to set in people picker
SetUserFieldValue("Name",userName);
function onError(error) {
//alert(error);
function SetUserFieldValue(fieldName, userName) {
var controlName = fieldName;
var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + controlName + "']");
var peoplePickerEditor = peoplePickerDiv.find("[title='" + controlName + "']");
var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
//comment out this field if edit form needs to be read only
peoplePickerEditor.val(userName);
//comment out this field if edit form needs to be read only
spPeoplePicker.AddUnresolvedUserFromEditor(true);
//disable the field
spPeoplePicker.SetEnabledState(false);
//hide the delete/remove use image from the people picker
$('.sp-peoplepicker-delImage').css('display','none');
GetCurrentUser();
</script>Hi David,
Below is the complete code I have used to load the current user to the people picker in SharePoint 2013.
$(document).ready(function(){
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', LoadCurrentUser);
function LoadCurrentUser() {
var context = SP.ClientContext.get_current();
var siteColl = context.get_site();
var web = siteColl.get_rootWeb();
this._currentUser = web.get_currentUser();
context.load(this._currentUser);
context.executeQueryAsync(Function.createDelegate(this, SetPickersToCurrentUser), Function.createDelegate(this, LoadUserfailed));
function LoadUserfailed() {
alert('failed');
function SetPickersToCurrentUser()
var loginName = this._currentUser.get_title();
SetPeoplePicker('Order Team', loginName);
function SetPeoplePicker(fieldName, userAccountName) {
var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + fieldName + "']");
var peoplePickerEditor = peoplePickerDiv.find("[title='" + fieldName + "']");
var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
peoplePickerEditor.val(userAccountName);
spPeoplePicker.AddUnresolvedUserFromEditor(true);
Let me know if you have any questions. I will help you out!
-Praveen.
ASP.NET and SharePoint developer
Blog: http://praveenbattula.blogspot.com
Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you. -
How to use Adobe Interactive forms with ISR frame work in Webdynpro forJava
Hi,
Anybody worked on Adobe Interactive forms with ISR frame work in Webdynpro for Java in ESS/MSS development.
We have already searched in ISR_Cookbook_2004, however we didn't anything related webdynpro for java in that.
Any information regarding this will be of great help.
Regards
Satish KumarThere are a number of issues here. A form that you created with LiveCycle Designer (XFA) cannot be used with FormsCentral. An Acroform, the kind you can create with Acrobat, can be used with FormsCentral, with certain limitations, one of which is skip logic. A dynamic XFA form allows for this type of thing, but as mentioned, they don't work with FormsCentral. You can set up an Acroform to show/hide or activate/inactivate fields based on selections or entries made in other fields, but you'd have to set this up in Acrobat, not FormsCentral. So you can set up something roughly equivalent to a web form's skip logic, but you'd have to learn how to do this in Acrobat using JavaScript. There is a separate Acrobat JavaScript forum here if you have any questions.
-
Hello.
I have created a search form with two iterators one for the results and the other for the search criteria. The search form works as expected. The name of the view that i am using is "MasterPartyView1". When i execute the following code
ViewObject voMasterParty = appMod.findViewObject("MasterPartyView1");
voMasterParty.setWhereClause("Id = " + MasterPartyId);
voMasterParty.executeQuery();
Row rowDest = voMasterParty.first();
in a backing bean and i go to the search form the only result that i a have is the row that i found in this statement (voMasterParty.setWhereClause("Id = " + MasterPartyId);).
Why is that?The adf search does not go every time in the database to fetch rows?
the only workaround for the moment is that i put these two extra lines in the backing bean
voMasterParty.setWhereClause(null);
voMasterParty.executeQuery();
which is not correct because i am fetching all the rows from the database i think.
Thank you in advance
PeriklisFrank thanks a lot for your answer but i still have some questions.
1 question: One workaround that i found is to the search with the view named MasterPartyView1 and have another instance of the view object(MasterPartyView2) in order to perform the custom search(setwhereclause).This seems to work. Is this approach correct?
2 question: if i understood correctly you say that both iterators point to the result set of the query (one row) and such is not possible to find other rows. But in the search form there is an invoke action
<invokeAction id="AlwaysInFindMode" Binds="Find"
RefreshCondition="${bindings.MasterPartyView1SearchIterator.findMode == false}"/>
that to my understanding puts the iterator in Find mode, thus making the input text fields available for criteria again. So the search iterator now points to QBE and it is possible to iterate over a collection of QBE criteria rows. is this correct?And if it is why it does not work as expected?Why it does not bring other results?Why the iterators (the seach iterator and the results iterator) still point to the newly created result set?
Thanks in advance
Periklis -
How to validate input fields as the user is filling up a form with jQuery?
Hello EA friends.
Someone has experimented on how to validate input fields as the user is filling up a form with jQuery?, if the field is numeric and insert an A for example, an alert appears showing "insert a number" or not allowed to enter anything until a number is entered.
Thanks and regards.
FerHi Sudeshna.
Sorry for not responding on time, how can I be included in this code?
sym.setVariable("typeActivity", "input")
var Element_1=document.createElement(typeActivity);
$(Element_1).css({"text-align": "center"});
//Answer
sym.setVariable("Answer_1", "4");
sym.$("box_1").append(Element_1)
This code is on my creationComplete and it works fine.
Would greatly appreciate your help.
Regards.
Fer García -
Search and Address bar not working.
Hello, I have this problem were whenever I try to type in something into the search or addresys bars, nothing happens. It's like the enter key isn't working. There is not usual picture next to the search bar (the one that shows you what search engine you're using. If it's google it shows a "g" next to the bar). Instead there is just a picture of a blank page as a placeholder. When I try to go in and add a new search engine by managing the search engine list, there is no option to add a new search engine. I have already tried going into the firefox folder on my computer and deleted the formhistory.sqlite file that is the supposed problem. No avail. I have even gone so far to delete and reinstall firefox to my computer. Well, that didn't work either. So I waited until the next update to see if my problem would be fixed THEN. I am currently on firefox 19.0, which is, as of writing, the most current version. I have tried restarting firefox with all addons removed. And for good measure, I deleted anything that ended with ".sqlite" in my firefox folder. I have tried to get the the about:config menu but do not know how considering how my address bar refuses to search. The greatest thing is that my address bar can still remember all the sites I've typed into it before, but for some unknown reason, cannot take me to any of them! I really don't know what to do next. I can only suppose that I could try completely deleting everything firefox has stored on my computer, as I don't know if just uninstalling the program actually did that. Other then my search bar problem, firefox has been acting fairly normally besides a few minor hiccups here and there. I am trying to remember if I downloaded anything before my search bar problems started or not, but it is always a possibility. I did download the firefox beta for windows 8 metro mode but I can't remember if that was before or after firefox started acting up. It's possible considering that softonic thought they were being really nice by including fbdownloader for free with my firefox metro browser. I am now no longer using softonic ever again. But that's all the evidence I can think up right off the tip of my head. Sorry if this was kinda long, and if any of my description isn't clear or make sense please ask and I can try to verify. Also, if I haven't said this already, my search bar is only not working in firefox. Chrome, Internet Explorer, and Safari are all working fine. Just my luck, I guess. If anyone could help me out, I'd be much obliged. Not being able to use the address bar has been really inefficient. Thank you.
This is the solution I got:
on:
;-please follow these steps:
1. Enter about:config in the Firefox location bar and press Enter.
You should see a warning that making changes to the Firefox configuration can be potentially harmful to Firefox's integrity. Click the I'll be careful, I promise button to continue.
2 In the Search box at the top, enter keyword as the search term. You should see a few remaining items, one of these is keyword.URL. It should be bold.
3 Right-click on the keyword.URL setting and select MODIFY from the dropdown menu.
enter your favorite search engine
In my case
I entered
https://www.google.com/search?q=
And that was a super fix
for more cool stuffs like [http://example.com website Alexa ranking ] -
In dev server my payment advice form f110_prenum_chc is not working
hi,
friends i need urgent help.
1) i have copied f110_avis_in frm 000 client to 200 client with form name
z_prenum_dup.
2) i have copied f110_prenum_chc frm 000 client to 200 client form name
zf110_prenum_chc1.
3) then i modified my both forms in 200 saved assigned TRs and
transported frm DEV server to PRD server(client 700).
4)in dev server 200 client my both forms are working
but in prd server 700 client my form cheque z_prenum_dup is
working but payment advice form zf110_prenum_chc1 is
not working.
5) but i can see my both forms r their in 700 prd server in se71 t.code.
6) if i run f-58 tr.code and by switching on debug mode i can see my
cheque form but not payment advice form.
7) if i run in 200 client i can see my both forms.
can any body plz help me out of this issue.Dear,
I will be able to put some points, if you can give me some more idea about ur problem,
1, Does system giving any error..?
2, Can you see a preview..?
As I understood, it must not have any problem in transportation.
You can also check with Respective functional consultant whether he has done with required customization in NACE..?
One more thing you can do is,
open a program RSNAST00 and put break point at " PERFORM (tnapr-ronam) IN PROGRAM (tnapr-pgnam) USING returncode", here you can check at runtime ( While in debugging mode) the value of field TNAPR-FONAM, this value must be your SmartForm. If it is not the case then, there is problem with NACE settings and contact your functional counterpart.
Hope it's helpful .......Enjoy.
Regards,
Chetan -
Apple Mail Search and Spotlight do not work for locating email messages after upgrading to Lion 10.8.3 on my 27" iMac.
When searching in Apple Mail, sometimes a get a few results (with many missing), and sometimes no results at all.
I had absolutely no problems before with Snow Loepard.
I have reindexed mail and my startup drive. I have followed discussions regarding this matter and tried everything - a waste of time.
This is VERY serious for me - I have many thousands of messages that I archive and need to reference for work and clients, and now I cannot find them.I found out that I needed a $100 mini displayport to dual-link dvi adapter to make my $30" cinema display work with my macbook pro
http://store.apple.com/us/product/MB571Z/A/mini-displayport-to-dual-link-dvi-ada pter?fnode=51
When I found out that solved the problem, I took it back because that was too expensive for a stupid adapter, and it still didn't work perfectly. -
The Help Tab (OSX ML) where you search for something does not work
If I click "Help" and then search "expand" it will show me where expand is. But in CS6 when I clicked it the command would go through and pull up the page to expand pixels. Instead, I have to go find it. It works in every other Adobe app I use except Photoshop CC.
I am on the latest version and on CCHi Peter
Thanks a lot for your help (and sorry for not having answered quicker, but my boss gave me a more urgent task last week...).
Anyway, I did what you suggested (re-importing into a brand new project), and then the search for synonyms really worked! But, being a sceptical person, I did the same with another project, and with that one, it did not work. So, what I did next was compare all the settings of these two projects, and I found a difference.
RH8 now contains a function that's called 'Teilzeichenfolgensuche' (I don't know the English expression, but have a look at the attached picture: this is a screen shot from the second page when I generate WebHelp). After having done several tests, I came to the following conclusions:
Search for synonyms does not work in HTML-Help, but it does work in WebHelp (and maybe others, but they are not relevant for me, so I did not test them);
Search for synonyms does only work, when the function 'Teilzeichenfolgensuche' is NOT activated.
Could maybe somebody test this, too, and post here whether my conclusions are really correct?
Btw: This fact is not mentioned in the RH-Manual; actually, this function 'Teilzeichenfolgensuche' is not even mentioned there (at least not in the German edition)!!!
Can hardly wait to see your feedback; thanks again for everybody's support!
Kurt -
Wifi connection with 4s not working after installing new software ios6
wifi connection with 4s not working after installing ios 6.
Go to Settings > WiFi > Select your network and hit the right arrow to "Forget Network"
Then go to Settings > General > Reset Network Settings and try connecting again when the phone restarts. -
Search form with multi-tab result
Dear,
I would like to create a search form with multiple items. These can be different select lists (dont know yet if one list is going to be parent of another list).
If on the search form I press submit the result is used in the different tabs. (two page level tabs. THey can all have a different report.
When I switch between the tabs I can still see the original search form with the original filled in values.
Is this some kind of shared control or shared component like a navigation bar?
I would appreciate your help.
Kind regards,
NicoMost probably your problem is different, but I remembered another (possibly similar) problem.
A few months ago another guy had a problem related to PPR of content on a ShowDetailItem in a PanelTabbed. He had not set the whole ShowDetailItem as PPR target but he had set a PanelFormLayout inside the ShowDetailItem as a PPR target. The problem was workarounded by setting either the whole ShowDetailItem or the whole PanelTabbed as a PPR target. So if you have not set the whole ShowDetailItem as a PPR target of the "execute query" button (by using ShowDetailItem's "partialTriggers" attribute), please try what will happen if you set it.
Dimitar -
Hi all, is it possible in a search form with uix shows always the edit criteria with execute button and not when I click the find button?
Please help!!!
Matteo.I want show the edit criteria with results. Is it possible? How can I do this?
Any suggestion will be appreciated.
Thanks, matteo. -
Search menu function is not working
Hi
Search menu function is not working in one of my HRMS 9.1 (PT: 8.52.09 application.
Verity installed and executed the build registry search index aswell.
Please let me know if I miss something on configuring the search menu function.
Thanks
SoundappanPersonally I did not have to make any psappsrv.cfg changes for this particular 9.1 env or any other changes that I can remember. Is PS_HOME = PS_CFG_HOME though?
If you didn't specifically set PS_CFG_HOME to PS_HOME it defaults to something like $HOME/psft and the files would need to be there instead.
If you run psadmin what's it show as the Config Home?
If I unset PS_CFG_HOME i get
PSADMIN -- Tools Release: 8.52.07
Copyright (c) 1996, 2011, Oracle. All rights reserved.
PeopleSoft Server Administration
Config Home: /home/psoft/psft/pt/8.52And the files would need to be there rather than $PS_HOME/data/....
Now you could override that in your psappsrv.cfg file with
EMPLOYEE=PS_HOME/data/search PS_HOME I dont think can be used here as a variable... it needs to be the full path. the location here must lead directly to the EMPLOYEE directory
In 8.52 there are also some alternatives to this older style above.
See this peoplebook for 8.52 http://docs.oracle.com/cd/E28394_01/pt852pbh1/eng/psbooks/tsvt/book.htm?File=tsvt/htm/tsvt10.htm%23g037ee99c9453fb39_ef90c_10c791ddc07_102b for details.
In the past I've used shares or nfs mounts to have the process scheduler write directly to the appserver. But you could check out the new search server option too.
Let me know. -
Lion 10.7.1. Searching on iCal does not work
I have Lion 10.7.1. Searching on iCal does not work. Also, I tried searching form the spotlight search , it does not retrieve calendar entries. Note: my calendar files are on an encrypted disk image (but I enable the disk image , I can see the calendar).
Any advice ?
DagI have been searching for an answer to this problem for about 6 months. I took it to 2 genius'! Neither could find the problem and suggested I completely wipe my hard drive and reinstall all the software. There ahs to be another way!
Maybe you are looking for
-
Creating a webservice from PL/SQL Package in JDev 11g
Hi All... I have a PL/SQl package and I am using JDEv 11g. I want to create it as a webservice. I want to deploy it in a remote server. Can I deploy it from my client machine. In server Weblogic already started. What are the prerequisites, that we ne
-
Automatic startup of database in Unix
I would like my database to startup automatically whenever the server starts up. Where do I put the startup scripts in Unix?
-
Purchased albums, didn't get all the songs.
To preface, I get all my music off iTunes. The only music that is NOT purchased from iTunes are a handful of mixtapes, that are free anyways. I noticed that Eminem's album Recovery (Deluxe Edition) is lacking the songs "Cold Wind Blows", "25 to Life"
-
User profiles. Tomcat's web authentication
hi all ! I dont know if this has an easy implementation in JAVA. My webapp can have one user with different profiles, lets say administrative and manager. So one user could access both restricted areas in my program. The users/pass are saved in a Dat
-
I just got a new treo 650 (Telus) and I have been able to sync it to my Powerbook G4. but only by cable. I want to do it with the bluetooth. 1) when pairing with the BT Setup Wizard I get: "There were no supported services found on your device" - I t