Search Results

Search found 33258 results on 1331 pages for 'search form'.

Page 15/1331 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Data structure: sort and search effectively

    - by Jiten Shah
    I need to have a data structure with say 4 keys . I can sort on any of these keys. What data structure can I opt for? Sorting time should be very little. I thought of a tree, but it will be only help searching on one key. For other keys I'll have to remake the tree on that particular key and then find it. Is there any data structure that can take care of all 4 keys at the same time? these 4 fields are of total 12 bytes and total size for each record - 40 bytes.. have memory constraints too... operations are : insertion, deletion, sorting on different keys.

    Read the article

  • How to Search File Contents in Windows Server 2008 R2

    - by ybbest
    By default, windows search only search by File name. To configure windows search to search by contents you need configure the following: You need to make sure Windows Search Services feature is activated.(Check this article for details) Then, configure Windows Search by Open file explorer: Press Alt button –> go to tools –> Folder options –> search tab –> Here select, “Always search file names and content(this might take several minutes)” Press okay. Now your searches will work for file content like the good old days of XP. Another way to search the contents in file without Search configuration is to Type “contents:” in the Windows Explorer search box followed by the word, searches text files. This is a search filter which seems to be undocumented?

    Read the article

  • Search in Projects API

    - by Geertjan
    Today I got some help from Jaroslav Havlin, the creator of the new "Search in Projects API". Below are the steps to create a search provider that finds recently modified files, via a new tab in the "Find in Projects" dialog: Here's how to get to the above result. Create a new NetBeans module project named "RecentlyModifiedFilesSearch". Then set dependencies on these libraries: Search in Projects API Lookup API Utilities API Dialogs API Datasystems API File System API Nodes API Create and register an implementation of "SearchProvider". This class tells the application the name of the provider and how it can be used. It should be registered via the @ServiceProvider annotation.Methods to implement: Method createPresenter creates a new object that is added to the "Find in Projects" dialog when it is opened. Method isReplaceSupported should return true if this provider support replacing, not only searching. If you want to disable the search provider (e.g., there aren't required external tools available in the OS), return false from isEnabled. Method getTitle returns a string that will be shown in the tab in the "Find in Projects" dialog. It can be localizable. Example file "org.netbeans.example.search.ExampleSearchProvider": package org.netbeans.example.search; import org.netbeans.spi.search.provider.SearchProvider; import org.netbeans.spi.search.provider.SearchProvider.Presenter; import org.openide.util.lookup.ServiceProvider; @ServiceProvider(service = SearchProvider.class) public class ExampleSearchProvider extends SearchProvider { @Override public Presenter createPresenter(boolean replaceMode) { return new ExampleSearchPresenter(this); } @Override public boolean isReplaceSupported() { return false; } @Override public boolean isEnabled() { return true; } @Override public String getTitle() { return "Recent Files Search"; } } Next, we need to create a SearchProvider.Presenter. This is an object that is passed to the "Find in Projects" dialog and contains a visual component to show in the dialog, together with some methods to interact with it.Methods to implement: Method getForm returns a JComponent that should contain controls for various search criteria. In the example below, we have controls for a file name pattern, search scope, and the age of files. Method isUsable is called by the dialog to check whether the Find button should be enabled or not. You can use NotificationLineSupport passed as its argument to set a display error, warning, or info message. Method composeSearch is used to apply the settings and prepare a search task. It returns a SearchComposition object, as shown below. Please note that the example uses ComponentUtils.adjustComboForFileName (and similar methods), that modifies a JComboBox component to act as a combo box for selection of file name pattern. These methods were designed to make working with components created in a GUI Builder comfortable. Remember to call fireChange whenever the value of any criteria changes. Example file "org.netbeans.example.search.ExampleSearchPresenter": package org.netbeans.example.search; import java.awt.FlowLayout; import javax.swing.BoxLayout; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSlider; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.netbeans.api.search.SearchScopeOptions; import org.netbeans.api.search.ui.ComponentUtils; import org.netbeans.api.search.ui.FileNameController; import org.netbeans.api.search.ui.ScopeController; import org.netbeans.api.search.ui.ScopeOptionsController; import org.netbeans.spi.search.provider.SearchComposition; import org.netbeans.spi.search.provider.SearchProvider; import org.openide.NotificationLineSupport; import org.openide.util.HelpCtx; public class ExampleSearchPresenter extends SearchProvider.Presenter { private JPanel panel = null; ScopeOptionsController scopeSettingsPanel; FileNameController fileNameComboBox; ScopeController scopeComboBox; ChangeListener changeListener; JSlider slider; public ExampleSearchPresenter(SearchProvider searchProvider) { super(searchProvider, false); } /** * Get UI component that can be added to the search dialog. */ @Override public synchronized JComponent getForm() { if (panel == null) { panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); JPanel row1 = new JPanel(new FlowLayout(FlowLayout.LEADING)); JPanel row2 = new JPanel(new FlowLayout(FlowLayout.LEADING)); JPanel row3 = new JPanel(new FlowLayout(FlowLayout.LEADING)); row1.add(new JLabel("Age in hours: ")); slider = new JSlider(1, 72); row1.add(slider); final JLabel hoursLabel = new JLabel(String.valueOf(slider.getValue())); row1.add(hoursLabel); row2.add(new JLabel("File name: ")); fileNameComboBox = ComponentUtils.adjustComboForFileName(new JComboBox()); row2.add(fileNameComboBox.getComponent()); scopeSettingsPanel = ComponentUtils.adjustPanelForOptions(new JPanel(), false, fileNameComboBox); row3.add(new JLabel("Scope: ")); scopeComboBox = ComponentUtils.adjustComboForScope(new JComboBox(), null); row3.add(scopeComboBox.getComponent()); panel.add(row1); panel.add(row3); panel.add(row2); panel.add(scopeSettingsPanel.getComponent()); initChangeListener(); slider.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { hoursLabel.setText(String.valueOf(slider.getValue())); } }); } return panel; } private void initChangeListener() { this.changeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { fireChange(); } }; fileNameComboBox.addChangeListener(changeListener); scopeSettingsPanel.addChangeListener(changeListener); slider.addChangeListener(changeListener); } @Override public HelpCtx getHelpCtx() { return null; // Some help should be provided, omitted for simplicity. } /** * Create search composition for criteria specified in the form. */ @Override public SearchComposition<?> composeSearch() { SearchScopeOptions sso = scopeSettingsPanel.getSearchScopeOptions(); return new ExampleSearchComposition(sso, scopeComboBox.getSearchInfo(), slider.getValue(), this); } /** * Here we return always true, but could return false e.g. if file name * pattern is empty. */ @Override public boolean isUsable(NotificationLineSupport notifySupport) { return true; } } The last part of our search provider is the implementation of SearchComposition. This is a composition of various search parameters, the actual search algorithm, and the displayer that presents the results.Methods to implement: The most important method here is start, which performs the actual search. In this case, SearchInfo and SearchScopeOptions objects are used for traversing. These objects were provided by controllers of GUI components (in the presenter). When something interesting is found, it should be displayed (with SearchResultsDisplayer.addMatchingObject). Method getSearchResultsDisplayer should return the displayer associated with this composition. The displayer can be created by subclassing SearchResultsDisplayer class or simply by using the SearchResultsDisplayer.createDefault. Then you only need a helper object that can create nodes for found objects. Example file "org.netbeans.example.search.ExampleSearchComposition": package org.netbeans.example.search; public class ExampleSearchComposition extends SearchComposition<DataObject> { SearchScopeOptions searchScopeOptions; SearchInfo searchInfo; int oldInHours; SearchResultsDisplayer<DataObject> resultsDisplayer; private final Presenter presenter; AtomicBoolean terminated = new AtomicBoolean(false); public ExampleSearchComposition(SearchScopeOptions searchScopeOptions, SearchInfo searchInfo, int oldInHours, Presenter presenter) { this.searchScopeOptions = searchScopeOptions; this.searchInfo = searchInfo; this.oldInHours = oldInHours; this.presenter = presenter; } @Override public void start(SearchListener listener) { for (FileObject fo : searchInfo.getFilesToSearch( searchScopeOptions, listener, terminated)) { if (ageInHours(fo) < oldInHours) { try { DataObject dob = DataObject.find(fo); getSearchResultsDisplayer().addMatchingObject(dob); } catch (DataObjectNotFoundException ex) { listener.fileContentMatchingError(fo.getPath(), ex); } } } } @Override public void terminate() { terminated.set(true); } @Override public boolean isTerminated() { return terminated.get(); } /** * Use default displayer to show search results. */ @Override public synchronized SearchResultsDisplayer<DataObject> getSearchResultsDisplayer() { if (resultsDisplayer == null) { resultsDisplayer = createResultsDisplayer(); } return resultsDisplayer; } private SearchResultsDisplayer<DataObject> createResultsDisplayer() { /** * Object to transform matching objects to nodes. */ SearchResultsDisplayer.NodeDisplayer<DataObject> nd = new SearchResultsDisplayer.NodeDisplayer<DataObject>() { @Override public org.openide.nodes.Node matchToNode( final DataObject match) { return new FilterNode(match.getNodeDelegate()) { @Override public String getDisplayName() { return super.getDisplayName() + " (" + ageInMinutes(match.getPrimaryFile()) + " minutes old)"; } }; } }; return SearchResultsDisplayer.createDefault(nd, this, presenter, "less than " + oldInHours + " hours old"); } private static long ageInMinutes(FileObject fo) { long fileDate = fo.lastModified().getTime(); long now = System.currentTimeMillis(); return (now - fileDate) / 60000; } private static long ageInHours(FileObject fo) { return ageInMinutes(fo) / 60; } } Run the module, select a node in the Projects window, press Ctrl-F, and you'll see the "Find in Projects" dialog has two tabs, the second is the one you provided above:

    Read the article

  • Can this word search algorithm be made faster?

    - by Ashwin Singh
    Problem: Find a match of word S in text T Given: S and T are part of spoken and written English. Example: Match 'Math' in 'I love Mathematics' NOTE: Ignore CASES. My algorithm: STEP 1) Convert S, T to char[] STEP 2) for i=0, i < T.length , i++ STEP 3) for j=S.length-1, j>0 , j-- STEP 3 is the magic, instead of going about matching M,A,T,H, this matches M, H, T and finally A. This helps in eliminating a lot of possible partial matches. For example, if I go sequentially like M A as in Boyer Moore's method ... it can match Matter, Mass, Matchstick etc. using M _ _ H will bring down size of partial matches. STEP 4) if S[j]!=T[i] -> break; else if j==i -> PRINT MATCH

    Read the article

  • Denali CTP3 - Semantic Search 2 (Lots of documents)

    - by sqlartist
    Hi again, I thought I would improve on the previous post by actually putting a decent about of content into the Filetable - this time I used the opensource DMOZ Health document repository which contains 5,880 files inside 220 folders. The files are all html and are pretty small in size. The entire document collection is about 120Mb unzipped and 30Mb zipped. If any one is interested in testing this collection drop me a note and I will upload the dmoz_health repository archive to Skydrive. This time...(read more)

    Read the article

  • Bubble shooter search alghoritm

    - by Fofole
    So I have a Matrix of NxM. At a given position (for ex. [2][5]) I have a value which represents a color. If there is nothing at that point the value is -1. What I need to do is after I add a new point, to check all his neighbours with the same color value and if there are more than 2, set them all to -1. If what I said doesn't make sense what I'm trying to do is an alghoritm which I use to destroy all the same color bubbles from my screen, where the bubbles are memorized in a matrix where -1 means no bubble and {0,1,2,...} represent that there is a bubble with a specific color. This is what I tried and failed: public class Testing { static private int[][] gameMatrix= {{3, 3, 4, 1, 1, 2, 2, 2, 0, 0}, {1, 4, 1, 4, 2, 2, 1, 3, 0, 0}, {2, 2, 4, 4, 3, 1, 2, 4, 0, 0}, {0, 1, 2, 3, 4, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, }; static int Rows=6; static int Cols=10; static int count; static boolean[][] visited=new boolean[15][15]; static int NOCOLOR = -1; static int color = 1; public static void dfs(int r, int c, int color, boolean set) { for(int dr = -1; dr <= 1; dr++) for(int dc = -1; dc <= 1; dc++) if(!(dr == 0 && dc == 0) && ok(r+dr, c+dc)) { int nr = r+dr; int nc = c+dc; // if it is the same color and we haven't visited this location before if(gameMatrix[nr][nc] == color && !visited[nr][nc]) { visited[nr][nc] = true; count++; dfs(nr, nc, color, set); if(set) { gameMatrix[nr][nc] = NOCOLOR; } } } } static boolean ok(int r, int c) { return r >= 0 && r < Rows && c >= 0 && c < Cols; } static void showMatrix(){ for(int i = 0; i < gameMatrix.length; i++) { System.out.print("["); for(int j = 0; j < gameMatrix[0].length; j++) { System.out.print(" " + gameMatrix[i][j]); } System.out.println(" ]"); } System.out.println(); } static void putValue(int value,int row,int col){ gameMatrix[row][col]=value; } public static void main(String[] args){ System.out.println("Initial Matrix:"); putValue(1, 4, 1); putValue(1, 5, 1); showMatrix(); for(int n = 0; n < 15; n++) for(int m = 0; m < 15; m++) visited[n][m] = false; //reset count count = 0; //dfs(bubbles.get(i).getRow(), bubbles.get(i).getCol(), color, false); // get the contiguous count dfs(5,1,color,false); //if there are more than 2 set the color to NOCOLOR for(int n = 0; n < 15; n++) for(int m = 0; m < 15; m++) visited[n][m] = false; if(count > 2) { //dfs(bubbles.get(i).getRow(), bubbles.get(i).getCol(), color, true); dfs(5,1,color,true); } System.out.println("Matrix after dfs:"); showMatrix(); } }

    Read the article

  • doing a full permutation search and replace on a string

    - by user73307
    I'm writing an app that does something like a custom number (licence) place generator tool where if I ask for the plate "robin" it will suggest I try: r0bin rob1n r0b1n Are there any published algorithms which can do this? It has to be able to handle replacing single letters with multiples, e.g. m with rn and vise-versa and not fall over if it replaces an i with an l then comes to check the l and replaces it back to an i. The list of what gets swapped with what is going to be user input but I'm not expecting a huge list, possibly 10 pairs at most. I'll be implementing this in Ruby or Python but I should be able to convert code from any other language.

    Read the article

  • How to optimise the url for search engines?

    - by phpheini
    I have a php template which has one index.php and all the different pages (content1.html, content2.html etc) are shown on the index.phppage. So for example I can open www.example.com/index.php?content1 and it will show the content1.html. Now what I would like is this: Often you see websites where the url is like: www.example.com/this-is-the-content I know how to do this with an exclamation mark like www.example.com/?content1 <-- here you just dont write the index.php. But how can I do an url name, which is completely different from the filename? For example www.example.com/this-is-some-page would show me the content of index.php?content1

    Read the article

  • Search Engine Query Word Order

    - by EoghanM
    I've pages with titles like 'Alpha with Beta'. For every such page, there is an inverse page 'Beta with Alpha'. Both pages link to each other. When someone on Google searches for 'Beta with Alpha', I'd like them to land on the correct page, but sometimes 'Alpha with Beta' ranks higher (or vice versa). I was thinking of inspecting the referral link when a visitor arrives on my site, and silently redirecting them to the correct page based on what they actually searched for. Just wondering if this could be penalized by Google as 'cloaking/sneaky redirects'? Or is there a better way to ensure that the correct page on my site ranks higher for the matching query?

    Read the article

  • Does searching a keyword on Google make the crawlers look harder in the future?

    - by Foo Bar
    Do the search requests made by the users influence the Google crawlers "attraction" by this keyword? Let's say Google has some hits on a specific keyword in the search index. And now I search for exactly this keyword. Will the Google crawlers react to the search and keep looking more intense for pages that could match this keyword? A reason why this could be important: Privacy when searching yourself. Assume you just want to know how much Google (and thus other people) can find out about you. If now any (statistical) additional search for your name trigger the crawlers even one step harder to find even more about you, it would have the negative effect that you would actually be found easier in the future, even though you had the intention and hope to find out how few Google finds about you. It's a bit like the dillema in quantum mechanis: Does observing the system automatically change the system?

    Read the article

  • ZF: Form array field - how to display values in the view correctly

    - by Wojciech Fracz
    Let's say I have a Zend_Form form that has a few text fields, e.g: $form = new Zend_Form(); $form->addElement('text', 'name', array( 'required' => true, 'isArray' => true, 'filters' => array( /* ... */ ), 'validators' => array( /* ... */ ), )); $form->addElement('text', 'surname', array( 'required' => true, 'isArray' => true, 'filters' => array( /* ... */ ), 'validators' => array( /* ... */ ), )); After rendering it I have following HTML markup (simplified): <div id="people"> <div class="person"> <input type="text" name="name[]" /> <input type="text" name="surname[]" /> </div> </div> Now I want to have the ability to add as many people as I want. I create a "+" button that in Javascript appends next div.person to the container. Before I submit the form, I have for example 5 names and 5 surnames, posted to the server as arrays. Everything is fine unless somebody puts the value in the field that does not validate. Then the whole form validation fails and when I want to display the form again (with errors) I see the PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given Which is more or less described in ticket: http://framework.zend.com/issues/browse/ZF-8112 However, I came up with a not-very-elegant solution. What I wanted to achieve: have all fields and values rendered again in the view have error messages only next to the fields that contained bad values Here is my solution (view script): <div id="people"> <?php $names = $form->name->getValue(); // will have an array here if the form were submitted $surnames= $form->surname->getValue(); // only if the form were submitted we need to validate fields' values // and display errors next to them; otherwise when user enter the page // and render the form for the first time - he would see Required validator // errors $needsValidation = is_array($names) || is_array($surnames); // print empty fields when the form is displayed the first time if(!is_array($names))$names= array(''); if(!is_array($surnames))$surnames= array(''); // display all fields! foreach($names as $index => $name): $surname = $surnames[$index]; // validate value if needed if($needsValidation){ $form->name->isValid($name); $form->surname->isValid($surname); } ?> <div class="person"> <?=$form->name->setValue($name); // display field with error if did not pass the validation ?> <?=$form->surname->setValue($surname);?> </div> <?php endforeach; ?> </div> The code work, but I want to know if there is an appropriate, more comfortable way to do this? I often hit this problem when there is a need for a more dynamic - multivalue forms and have not find better solution for a long time.

    Read the article

  • search form in html/php via ajax

    - by fusion
    i've a search form wherein the database query has been coded in php and the html file calls this php file via ajax to display the results in the search form. the problem is, i would like the result to be displayed in the same form as search.html; yet while the ajax works, it goes to search.php to display the results. search.html: <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="scripts/search_ajax.js" type="text/javascript"></script> </head> <body> <form id="submitForm" method="post"> <div class="wrapper"> <div class="field"> <input name="search" id="search" /> </div><br /> <input id="button1" type="submit" value="Submit" class="submit" onclick="run_query();" /><br /> </div> <div id="searchContainer"> </div> </form> </body> </html> if i add action="search.php" to the form tag, it displays the result but on search.php. i'd like it to display on the same form [i.e search.html, and not search.php] if i just add the javascript function [as done above], it displays nothing on search.html

    Read the article

  • Zend_Form using subforms getValues() problem

    - by wiseguydigital
    Hi all, I am building a form in Zend Framework 1.9 using subforms as well as Zend_JQuery being enabled on those forms. The form itself is fine and all the error checking etc is working as normal. But the issue I am having is that when I'm trying to retrieve the values in my controller, I'm receiving just the form entry for the last subform e.g. My master form class (abbreviated for speed): Master_Form extends Zend_Form { public function init() { ZendX_JQuery::enableForm($this); $this->setAction('actioninhere') ... ->setAttrib('id', 'mainForm') $sub_one = new Form_One(); $sub_one->setDecorators(... in here I add the jQuery as per the docs); $this->addSubForm($sub_one, 'form-one'); $sub_two = new Form_Two(); $sub_two->setDecorators(... in here I add the jQuery as per the docs); $this->addSubForm($sub_two, 'form-two'); } } So that all works as it should in the display and when I submit without filling in the required values, the correct errors are returned. However, in my controller I have this: class My_Controller extends Zend_Controller_Action { public function createAction() { $request = $this->getRequest(); $form = new Master_Form(); if ($request->isPost()) { if ($form->isValid($request->getPost()) { // This is where I am having the problems print_r($form->getValues()); } } } } When I submit this and it gets past isValid(), the $form-getValues() is only returning the elements from the second subform, not the entire form.

    Read the article

  • search form in php via ajax

    - by fusion
    i've a search form wherein the database query has been coded in php and the html file calls this php file via ajax to display the results in the search form. the problem is, i would like the result to be displayed in the same form as search.html; yet while the ajax works, it goes to search.php to display the results. search.html: <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="scripts/search_ajax.js" type="text/javascript"></script> </head> <body> <form id="submitForm" method="post"> <div class="wrapper"> <div class="field"> <input name="search" id="search" /> </div><br /> <input id="button1" type="submit" value="Submit" class="submit" onclick="run_query();" /><br /> </div> <div id="searchContainer"> </div> </form> </body> </html> if i add action="search.php" to the form tag, it displays the result but on search.php. i'd like it to display on the same form [i.e search.html, and not search.php] if i just add the javascript function [as done above], it displays nothing on search.html

    Read the article

  • Spring Form: Submitting extra parameter on submit buttons

    - by theringostarrs
    Hi, I am working on a form with a bunch of selection criteria that will generate a report when the form is submitted. I also have a number of different reports that can be generated form this same criteria, and want the type of report to be selectable by using a tab system where each tab clicked on submits the form and generates the correct report. I was to do this by passing an extra parameter into the form to switch onto the right form type I am new to Spring, and from the guidance of an elder was told to use an input button for each tab with the following approximate syntax: <input type="submit" name="${form.selectionValues.tabSelection}" value="1" /> tabSelection form property of the SelectionValues object is not being set. I wasn't surprised ;) DIdn't think this would work. So I am wondering how can I can submit a post back from a button in Spring containing the form values plus an extra tabSelection parameter and value? How should I mark up this mechanism? Will I have to do anything to the form controller to register this extra parameter? The original markup I was using to build this page, was using HTML anchor tags instead of buttons for the tab links, which would be much better for the CSS, is there any way to trigger a full form submit using an anchor href? I know this will be a GET request instead of a POST, and not associated with the form.. so I dont expect this to work.. just trying to think of solutions! I would prefer to use the priginal markup, as the styles are there. Any help would be appreciated

    Read the article

  • How to create the automatic mass form submitter (javascript-ajax script) to be used on the 3rd part

    - by Daniel
    I need a script that can handle the following tasks. Take user data from my database and fill in and submit / post data to forms located on third part websites.: So I want to know if is it hard to create or do somebody knows if does exists some script for mass form submissions in PHP -Javascript-Ajax ? I run Dancers & Hostess & Model jobs website, I would like to find some script which allows the girls automaticly submit to hundreds websites forms (other 3rd part model agencies) with their similar model application form info on my website previously specified, 1).Firstly the girls will fill out my agency portfolio very detailed form , like this i will get all the model personal info from them , 2) Secondly i would like to allow for example models to submit to 100 and more other model agencies forms (I will find those websites before, and I will get their field names = values and thanks to some script would like to connect them with every girl data already created in my website to submit . I would like to implement it to my wordpress website where the girls has their portfolios instead of my pages . I would like to offer this service especially to models , it should work like some directory submitters , The script knows names - values and fill it out itself, but I want it online - browser side, where the girls should only fill out captcha if there is and click the button "submit".After succesful submit it should offer other form to submit. I would be very happy if you know the answer or if you can redirect me to some article

    Read the article

  • Drupal 6 Validation for Form Callback Function

    - by Wade
    I have a simple form with a select menu on the node display page. Is there an easy way to validate the form in my callback function? By validation I don't mean anything advanced, just to check that the values actually existed in the form array. For example, without ajax, if my select menu has 3 items and I add a 4th item and try to submit the form, drupal will give an error saying something similar to "an illegal choice was made, please contact the admin." With ajax this 4th item you created would get saved into the database. So do I have to write validation like if ($select_item > 0 && $select_item <= 3) { //insert into db } Or is there an easier way that will check that the item actually existed in the form array? I'm hoping there is since without ajax, drupal will not submit the form if it was manipulated. Thanks. EDIT: So I basically need this in my callback function? $form_state = array('storage' => NULL, 'submitted' => FALSE); $form_build_id = $_POST['form_build_id']; $form = form_get_cache($form_build_id, $form_state); $args = $form['#parameters']; $form_id = array_shift($args); $form_state['post'] = $form['#post'] = $_POST; $form['#programmed'] = $form['#redirect'] = FALSE; drupal_process_form($form_id, $form, $form_state); To get $_POST['form_build_id'], I sent it as a data param, is that right? Where I use form_get_cache, looks like there is no data. Kind of lost now.

    Read the article

  • Simple search only searching last word of record

    - by bennett_an
    I set up a simple search as instructed in part of railscast #240. in controller @reports = Report.search(params[:search]).order('created_at DESC').paginate(:page => params[:page], :per_page => 5) in model def self.search(search) if search where('apparatus LIKE ?', "%#{search}") else scoped end end in view <%= form_tag reports_path, :method => :get do %> <p> <%= text_field_tag :search, params[:search] %> <%= submit_tag "Search", :name => nil %> </p> <% end %> it all works... but... I have a few records for example, one with "another time test" and another with "last test of time" if i search "test" the first comes up but the second doesn't, and if i search "time" the second comes up but not the first. It is only seeing the last word of the record. what gives?

    Read the article

  • How do I display two different objects in a search?

    - by JZ
    github url I am using a simple search that displays search results: @adds = Add.search(params[:search]) In addition to the search results I'm trying to utilize a method, nearbys(), which displays objects that are close in proximity to the search result. The following method displays objects which are close to 2, but it does not display object 2. How do I display object 2 in conjunction with the nearby objects? @adds = Add.find(2).nearbys(10) While the above code functions, when I use search, @adds = Add.search(params[:search]).nearbys(10) a no method error is returned, undefined methodnearbys' for Array:0x30c3278` How can I search the model for an object AND use the nearbys() method AND display all results returned? Model: def self.search(search) if search find(:all, :conditions => ['address LIKE ?', "%#{search}%"]) # where('address LIKE ?', "%#{search}") else find(:all) end end

    Read the article

  • why doesn't hitting enter when a SELECT is focused submit the form?

    - by Marc
    Consider the following HTML: <form action=""> <input /> <select> <option>A</option> <option>B</option> </select> <input type="submit" /> </form> If the focus is on the input (text box) and I hit enter, the form submits. But, if the focus is on the select (dropdown box) and I hit enter, nothing happens. I know I could figure out some JavaScript to override this, but I want to know why hitting enter doesn't just work? Is there something I would break by capturing the enter with JavaScript (maybe some native keyboard accessibility of the dropdown)?

    Read the article

  • What text file search tool are you using?

    - by user156144
    I am working on legacy projects with thousands of files spanning more than 10 projects. I am wondering what other people are using for searching string in a text file. I am using windows and i typically search on 10,000 files to make sure some code is not called from other places. I've tried numerous text search tools mentioned here such as Actual Search & Replace, Ultraedit, notepad++ but they all take very long time to search due to the large # of files they have to look into.

    Read the article

  • How can I create a link to a custom form in Outlook 2003

    - by Mulmoth
    If I created a custom form (including Script) in Outlook 2003, published it to the personal forms library, the only way I know to create a item out of this form is "File - New - Choose Form... - Personal Forms Library - Select my Form - Ok". Is there a faster way? For example, a link from the desktop or from the Outlook favorites folder?

    Read the article

  • Firefox addon for searching with different search engines

    - by alex
    I want to be able to right click on the selected text and, instead of Search Google for [whatever is selected], I want to have a submenu that allows me to choose the search engine I want. The list of search engines has to be the exact list of search engines I have. I know there is such an add-on, because I've used something like this in the past, only I can't remember its name.

    Read the article

  • One click to trigger several search forms?

    - by Christian
    Hello, I have 1 main search form with a submit button and several secondary search forms with submit buttons. What I would like to do is when I enter text and click on the submit button of the main search form, the same text gets copied in all of the secondary search forms and all the submit buttons of the secondary search forms get automatically hit. The HTML code for the mains earch form is shown below: <form action="query.php" method="get"> Search: <input type="text" name="item" size="30"> <input type="submit" value="send"> </form> One of the several secondary search forms is shown below: <FORM action="http://www.dpbolvw.net/interactive" method="GET" target="_blank"> <div style="float: left; padding: 0 3px 0 0;"> <INPUT type="text" name="src" size="9" value="<?php $input = $_GET['item']; echo $input;?>" style="width: 110px; height: 22px;margin:0; padding: 0; font-size:140%;"> </div> <div style="float: left; padding: 0 3px 0 0;"> <input type="image" name="submit" value="GO" src="http://images.guitarcenter.com/Content/GC/banner/go.gif" alt="Search" style="font-size:140%"> /div> <input type="hidden" name="aid" value="1234"/> <input type="hidden" name="pid" value="1234"/> <input type="hidden" name="url" value="http://www.guitarcenter.com/Search/Default.aspx"/> </form> Notice the php code that I put in the "value" field of the secondary search form: <?php $input = $_GET['item']; echo $input;?> This automatically copies the text that I entered in the main search form into the secondary search form. I thus figured out how to do that. The problem is to "simulate" an "Enter" keystroke or a click on the "GO" button with the mouse on the secondary search form when the user hits the Enter key or hits the "SEND" button with the mouse on the main search form. Thank you for your insight!

    Read the article

  • HTML: upload-form in an other form

    - by chris
    hi! I have a little problem with an upload-form within an other form (call it data-form). I know it is not possible to put a form into an other. So I would need to put it after my data-form. But I need the upload-form controls in the middle of my data-form because of optical and structural reasons. The file-upload should also perform other actions and not the same than the data-form. So any idea how can I make the upload-form after my data-form but visible in it or any other ideas to handle this? I am using javascirpt and php also. thanks and best wishes for 2011! br,chris

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >