HTML - Question - Search Form (if/then)
Hello,
I am new to posting on HTMLforums.com. I have a quick question for someone that has a good understanding of HTML (and most likely JS). On the front page of SWFL.cc I have a search box to the left. It is connected to the php search functionality in the Open-Realty Script. I would like to know if there is a way to get this functionality: I have the Purchase/Rental drop down, and I would like to know if there is any way to change the price variables depending on the selection of the purchase/rental drop down. If this is possible, could someone point me in the right direction to figure out how to go about doing this. Thank You, Brian Meyer Similar TutorialsHi everyone, I'm a total newbie and have zero previous HTML experience (but have experience reading code). I am modifying a site to support 3 radio buttons that switch the function of a single search bar. Could you guys please help me figure this out? Warning - all of this is copy-and-paste frankencode from the source, pieced together by guesswork. It may hurt your eyes. In case you're wondering, this is simply a design prototype for a class I am taking that requires user testing. The actual web development will be done by someone else if accepted. I will learn HTML properly later on. Attached is an image of what I am thinking of. And here is the pertinent code: Code: <h2>Select the search engine that meets your needs.</h2> <form id="form1" name="form1" method="post" action=""> <p> <label> <input name="searchEngineSelection" type="radio" id="searchEngineSelection_0" value="http://uci.worldcat.org/search" checked="checked" /> <strong>Melvyl</strong></label> - Search libraries worldwide for books/music/other media.<br /> <label> <input name="searchEngineSelection" type="radio" id="searchEngineSelection_1" value="http://antpac.lib.uci.edu/search/X?SEARCH=" /> <strong>ANTPAC</strong></label> - Search and reserve material held at UCI Libraries.<br /> <label> <input type="radio" name="searchEngineSelection" value="http://www.lib.uci.edu/search-site.html?cx=009602760963559712792%3Aoglsjsxdz5m&cof=FORID%3A10&ie=UTF-8&q=" id="searchEngineSelection_2" /> <strong>Site</strong></label> - Find a specific page or information on the Library website.<br /> </p> </form> <form accept-charset="UTF-8" action="http://uci.worldcat.org/search" id="wcfw" method="get" name="wcfw" target="_top"> <input name="q" type="text" id="quicksearch_field" /> <input align="top" id="quicksearch_go" onmouseout="goBtnOff()" onmouseover="goBtnOn()" src="./Home Page - UCI Libraries_files/button-go-off.gif" type="image" /> </form> I have no idea how to do it so I am asking you gurus to help. Thanks so much for your time. Hey - I'm trying to fix a piece of code which will allow me to insert a Library Catalogue Search form in to my Institute's moodle. The form appears, but the search is not populated with the information input when I click search. I'm using the following code, and my catalogue page is: http://library.kcl.ac.uk/F/X1C8CFNNK...le_name=find-b HTML Code: <w:populate using="itemForEdit"> <form action="http://library.kcl.ac.uk/F/X1C8CFNNK32DAV3PAY9E1HTAQTU595XKRFJXY589I72VT6QR3V-48067?func=file&file_name=find-b" method="post"> <input type="hidden" name="Id" /> <table align="center"> <tbody> <tr> <td><label>Search: </label> </td> <td><input type="text" name="Name" /> </td> </tr> <tr> <td><label>Search by: </label> </td> <td> <select name="find_code"> <option value="WRD">All Words</option> <option value="WTI">Title words</option> <option value="WJT">Journal title words</option> <option value="WPE">Authors/Names</option> <option value="WME">Conferences</option> <option value="WCO">Organisations</option> <option value="WPF">Performers</option> <option value="WMU">Year of recording</option> <option value="WPT">Printers</option> <option value="WPV">Provenance</option> <option value="WPU">Publishers</option> <option value="WSE">Series</option> <option value="WSU">Subject words</option> <option value="WIB">ISBN</option> <option value="WIS">ISSN</option> <option value="WLN">Language</option> <option value="WYR">Year published</option> <option value="WCL">Collection code</option> <option value="WCK">Classmark</option> <option value="SYS">System number</option> <option value="BAR">Barcode</option> </select> </td> </tr> <tr> <td align="center" colspan="2"> <input type="submit" value="Search Library Catalogue" /> </td> </tr> </tbody> </table> <tags:hiddenoperationparam> </tags:hiddenoperationparam></form></w:populate> All suggestions much appreciated! Hi there, quite a lame question i think.. Anyone have on idea on a script, (which i believe should be quite simple) which can extract the line from an csv file and show ot in a html page at search request. In more details it should look like this : somebody enters some word in simple html search form and pushes search button, the script searches through the csv file and copies whole line with matchin word in the web page. Or maybe there is a simplier way, since csv file can be converter to any other format... Thanks in advance. Hey guys I have made search form on my site but how do i get it to search my site when the user clicks search. Tried to find a tutorial on this but no luck. HTML Code: <form action="?" method="post" name="searchfield" id="searchfield"> <p>Search the Web: <input name="search" type="text" class="search" size="15" /> <input name="submit" type="submit" class="submit" value="Search" /> </p> </form> I know I have to create a script which I wold like to do in php but what do I add to the script Hi, I am having a problem. I have a HTML table on my webpage but I am having trouble searching it from my main homepage using a HTML form. The html form on the homepage is: <html> <body> <form method="post" action="http://www.example.com/sites/default/files/html_table.html" <input type="text" size="30" maxlength="1000" value="" id="textBoxSearch" onkeyup="tableSearch.search(event);" /> <input type="submit" value="Search" onclick="tableSearch.runSearch();" /> </body> </html> I have a search working fine on the html page and javascript functions conducting the search as shown he <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>JavaScript Search</title> <style type="text/css"> body { font-family: Arial; font-size: 11px; } td { font-family: Arial; font-size: 11px; } th { font-family: Arial; font-size: 11px; background-color: #c8c8c8; } input { font-family: Arial; font-size: 11px; } </style> <script language="javascript" type="text/javascript"> //define the table search as an object, which can implement both functions and properties window.tableSearch = {}; //initialize the search, setup the current object tableSearch.init = function() { //define the properties I want on the tableSearch object this.Rows = document.getElementById('data').getElementsByTagName('TR'); this.RowsLength = tableSearch.Rows.length; this.RowsText = []; //loop through the table and add the data to for (var i = 0; i < tableSearch.RowsLength; i++) { this.RowsText[i] = (tableSearch.Rows[i].innerText) ? tableSearch.Rows[i].innerText.toUpperCase() : tableSearch.Rows[i].textContent.toUpperCase(); } } //onlys shows the relevant rows as determined by the search string tableSearch.runSearch = function() { //get the search term this.Term = document.getElementById('textBoxSearch').value.toUpperCase(); //loop through the rows and hide rows that do not match the search query for (var i = 0, row; row = this.Rows[i], rowText = this.RowsText[i]; i++) { row.style.display = ((rowText.indexOf(this.Term) != -1) || this.Term === '') ? '' : 'none'; } } //runs the search tableSearch.search = function(e) { //checks if the user pressed the enter key, and if they did then run the search var keycode; if (window.event) { keycode = window.event.keyCode; } else if (e) { keycode = e.which; } else { return false; } if (keycode == 13) { tableSearch.runSearch(); } else { return false; } } </script> </head> <body onload="tableSearch.init();"> <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td> <input type="text" size="30" maxlength="1000" value="" id="textBoxSearch" onkeyup="tableSearch.search(event);" /> <input type="button" value="Search" onclick="tableSearch.runSearch();" /> </td> </tr> </tbody> </table> <br /> <table border="1" cellpadding="2" cellspacing="0"> <tr> <th>ID</th> <th>First Name</th> <th>Surname</th> <th>Website</th> </tr> <tbody id="data"> <tr> <td>1</td> <td>Heathesh</td> <td>Bhandari</td> <td><a href="http://heathesh.com">http://heathesh.com</a></td> </tr> <tr> <td>2</td> <td>Candice</td> <td>David</td> <td><a href="http://candicedavid.com">http://candicedavid.com</a></td> </tr> </tbody> </table> </body> </html> If anybody could help me please! I have run out of ideas Hello I have been asked by my manager to build our company website (www.cityends.com) My enquiry is this, how do i use html to creat a form which can search the current properties we have. And how would i go about creating a database which this form is able to read Any help is very much appreciated, i am very new to building websites, any comments on my current effort are also appreciated Thanks Mark I am just getting back into html and im already having a few problems. I am making this website for my parents to help promote their new college and so far its look excellent except for the fact that I cant get this pesky search and dropdown list to align right. www.xgenservers.com/CFC/2/index.htm The site works perfectly in Mozilla Firefox, but I cannot get it to shape out right in Internet Explorer. I could really use a helping hand on this one, thanks a ton . I am trying to create a FORM with multiple option radio buttons. Basically this is a ready script I found on the internet. I have tried to customize it but there is a slight problem which I have been unable to fix after a lot of tries. In the below code, I am trying to open the following URLs on submit. http://www.pixmac.com/pictures/"searchterms"?a=kcalpesh http://www.crestock.com/image-keyword/"searchterms".aspx/112582/ In both the URLs the "searchterms" is dynamic and will be picked from the input box present in the form. PROBLEM PART! On submission, the URL that opens is only up to http://www.pixmac.com/pictures/"searchterms" and the affiliate ID after that gets missed. Same with the other URL on submission, the URL that opens is http://www.crestock.com/image-keyword/"searchterms" and again the affiliate ID gets missed out. Below is the complete page code for the FORM. Any help will be highly appreciated. I am not a coder and have very limited knowledge of HTML / Javascript!! <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Untitled Document</title> <script type="text/javascript"> function dosearch() { var sf=document.searchform; var submitto = sf.sengines.options[sf.sengines.selectedIndex].value + escape(sf.searchterms.value); window.open(submitto); return false; } </script> </head> <body> <form name="searchform" onsubmit="dosearch();"> Search: <select name="sengines"> <option value="http://www.pixmac.com/pictures/"searchterms"?a=kcalpesh" selected="selected">Pixmac</option> <option value="http://www.crestock.com/image-keyword/"searchterms".aspx/112582/">Crestock</option> </select> For: <input name="searchterms" type="text"> <input name="SearchSubmit" value="Search" type="submit"> </form> </body> </html> I'm a noob so please forgive me if this is a stupid question or if the info is listed somewhere else. I really did try and find it on my own. I'm trying to make a simple website that incorporates amazon's free "astore". It has a search function included in the sidebar already but i don't like it and really want to set up my own. I found this search box code: Quote: <form action="http://astore.amazon.com/adbabel-20/search" method="get" target="_blank"> <input name="node" value="8" type="hidden"> <input name="keywords" size="12" value="" type="text"> <button type="submit" >Search</button> </form> it works well but is limited to searching only one category in my store (i have several). each category is assigned a "node" number. By changing the node value in the code I can change which category the box searches. I want to create a drop down list that, upon selection, changes the node value and thus the category that is to be searched. Can anyone let me know how this might be done? Hey all, I'm pretty sure this is a very easy solution, I've just been staring at it too long and am probably missing the cause. I'm using Google's site search API and using their "Results Only" setup, so I design my own search box, then just drop their code into the results page and specify the variable the query is being passed as. So here's my search box: Code: <form method="post" action="/search-results/?q="> <input id="searchTxt" type="text" maxlength="128" name="q" size="15" value="Search" onfocus="if (this.value == 'Search') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search';}" /> <input type="image" name="op" value="Search" src="/wp-content/uploads/2011/07/search-button-magnifier.png" /> And the results code via Google: Code: <div id="cse" style="width: 100%;">Loading</div> <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> function parseQueryFromUrl () { var queryParamName = "q"; var search = window.location.search.substr(1); var parts = search.split('&'); for (var i = 0; i < parts.length; i++) { var keyvaluepair = parts[i].split('='); if (decodeURIComponent(keyvaluepair[0]) == queryParamName) { return decodeURIComponent(keyvaluepair[1].replace(/\+/g, ' ')); } } return ''; } google.load('search', '1', {language : 'en'}); google.setOnLoadCallback(function() { var customSearchControl = new google.search.CustomSearchControl('XXXXXXXXXXXXXXXXXXX'); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); var options = new google.search.DrawOptions(); options.enableSearchResultsOnly(); customSearchControl.draw('cse', options); var queryFromUrl = parseQueryFromUrl(); if (queryFromUrl) { customSearchControl.execute(queryFromUrl); } }, true); </script> <link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" /> But nothing seemingly the query is not sent with the user to the results page. Manually adding "?q=test" shows the results work. Am I missing something here? I'm using Wordpress on this site, so not sure if the permalink setup is screwing with it at all. Thanks for the help hi everyone, ok heres my problem that is bugging me. I have a ecommerce website that im setting up and it comes with a default search feature. Code: <form name="quick_find" action="MYDOMAIN/index.php?main_page=advanced_search_result" method="get"> <input type="hidden" name="main_page" value="advanced_search_result" /> <input type="hidden" name="search_in_description" value="1" /> <input type="text" name="keyword" size="18" maxlength="100" style="width: 103px; margin-right:5px; vertical-align:middle;" value="" onfocus="if (this.value == 'Enter search keywords here') this.value = '';" /> <input type="submit" value="Search" style="width: 50px; vertical-align:middle;" /> </form> on my site i sell music LP's and each lp has in its description the year it was released. If i was to put in the above form "1996" it would search all my products and return any that have "1996" in their desctiption. With this in mind i would like to create a form that had 4 drop down boxes. day,month,year,country I have created the following code below; Code: <form name="quick_find_header" action="MYDOMAIN/index.php?main_page=advanced_search_result" method="get"> <input type="hidden" name="main_page" value="advanced_search_result" /> <input type="hidden" name="search_in_description" value="1" /> <select name="keyword"> <option value="1952">1952</option> <option value="1953">1953</option> <option value="1954">1954</option> <option value="1955">1955</option> <option value="1956">1956</option> <option value="1957">1957</option> <option value="1958">1958</option> <option value="1959">1959</option> <option value="1960">1960</option> <option value="1961">1961</option> <option value="1962">1962</option> <option value="1963">1963</option> <option value="1964">1964</option> <option value="1965">1965</option> <option selected value="1966">1966</option> <option value="1967">1967</option> <option value="1968">1968</option> <option value="1969">1969</option> <option value="1970">1970</option> <option value="1971">1971</option> <option value="1972">1972</option> <option value="1973">1973</option> <option value="1974">1974</option> <option value="1975">1975</option> <option value="1976">1976</option> <option value="1977">1977</option> <option value="1978">1978</option> <option value="1979">1979</option> <option value="1980">1980</option> <option value="1981">1981</option> <option value="1982">1982</option> <option value="1983">1983</option> <option value="1984">1984</option> <option value="1985">1985</option> <option value="1986">1986</option> <option value="1987">1987</option> <option value="1988">1988</option> <option value="1989">1989</option> <option value="1990">1990</option> <option value="1991">1991</option> <option value="1992">1992</option> <option value="1993">1993</option> <option value="1994">1994</option> <option value="1995">1995</option> <option value="1996">1996</option> <option value="1997">1997</option> <option value="1998">1998</option> <option value="1999">1999</option> <option value="2000">2000</option> <option value="2001">2001</option> <option value="2002">2002</option> <option value="2003">2003</option> <option value="2004">2004</option> <option value="2005">2005</option> </select> <select name="keyword"> <option value="01">Jan</option> <option value="02">Feb</option> <option value="03">Mar</option> <option value="04">Apr</option> <option value="05">May</option> <option value="06">Jun</option> <option selected value="07">Jul</option> <option value="08">Aug</option> <option value="09">Sep</option> <option value="10">Oct</option> <option value="11">Nov</option> <option value="12">Dec</option> </select> <select name="keyword"> <option value="01">01</option> <option value="02">02</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option> <option value="06">06</option> <option value="07">07</option> <option selected value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> <input type="image" src="includes/templates/theme013/buttons/english/button_search.gif" alt="Search" title=" Search " style="margin-left:1px;" /> </form> this gives me 3 drop down box's (YEAR,MONTH,DAY) The problem is when i click search it only searches for the year. instead of combining all the selected data (e.g. 1996+JUN+23) it just searched for 1996. The second problem is if someone managed to get this form to work, would it search for "1996JUN23" or "1996 JUN 23". The reason i ask this is my products descriptions say "this single was released on 23 June 1996" I hope ive made all the above clear!! Any help would be greatly appreciated. thanks in advance Hello, The department I work for recently asked me if I could add a search tool to the front page of our home page. Unfortunately, this is new to me as I've never had to (or tried to) do anything like that before. At this point I'm not sure where to begin or if it can be done with the home page we have. Our website is pretty extensive so I can understand the need. I kindly thank anyone who would be willing to get me started. The website has been developed from adobe golive, if that's important. Thanks again. http://wellnessandpreventionoffice.org/ Hi. I want to make a form with an input field in one table cell and the submit button in another cell. How can i do this? Parashurama Hi, how can I position a <form> om my page in html? WHat or how does it work? please give example. thanks I have created a form that just consist of a comments section and a submit button. Right now it is set to email the comments posted. The problem is we would like to keep the persons identity secret. See, when the person hits submit it brings up their email software and sends the email with their email address. We dont want to know their email address. So question is - is there a way of sending the email when they hit submit w/o us seeing their email address? or is there a different way of the person sending their comments w/o us knowing who it came from? Thanks! here is my html: <table><form method= "post" enctype="text/plain" action="mailto:my@my.com"> <colgroup align="left" valign="top"> <tr> <td>Comments:</td> <td><textarea name="comments" rows="5" cols="70" /></textarea></td> </tr> <tr> <td></td> <td><input type="submit" value="Submit" />  <input type="reset" value="Clear" /></td> </tr> </colgroup> </table> Hello, Please forgive me if this makes no sense at all, I have been trying to figure this out for awhile now and just dont really understand forms. I am trying to figure out how to make the form on my website work. http://www.legrandmotorsports.com/service_status/ The purpose of the form is to have customers enter their service tag number, click submit, and be able to view the status of their service work. Heres what I am trying to do... Whether or not its possible, I dont know? I would upload the service status html pages by thier tag number under the service_status directory. Example: legrandmotorsports.com/service_status/4151.html Now, my question is, is there a way to set this form up, so that the number the customers typed in, would be automatically put into the link "legrandmotorsports.com/service_status/SERVICE NUMBER HERE.HTML" Then whenever they click submit, the number they typed, would be added to the link, taking them to their service status updates. Is this possible? Or do you have any recommendations on how I could/should do this? Any help is grately appreciated. Pete Hi guys, I have a client who's on a budget and has a unique need in one of their forms on the website. They are a shuttle company that caters to college students. In the form, there will be a drop-down option for University, and when you choose one, a second drop-down field needs to appear below to select the dormitory, from a list. I wanted to know if anyone had any simple, affordable ideas to get this done. Any feedback is appreciated, thanks alot! You guys have helped me alot in the past and I thank you. -Nick Intuition Designs LLC Hey all. I haven't designed a website in over 5 years and am extremely rusty. I'm trying to create a contact form and i have a question. When i hit submit it opens up outlook and just fills in the too with the e-mail i choose and the body has the content of the form. I don't want it to do this. When i hit submit i want it to send the contents of the form to an e-mail of my choosing and then take you to another page that says "Thank You for your submission" or something along those lines. Right now i have: <form action="MAILTO:example@example.com" method="post" enctype="text/plain"> <h3>Please fill out the form below and someone will be in touch with you shortly.</h3> Name: <br/> <input type="text" name="name"/> <br/> City: <br/> <input type="text" name="city"/> <br/> State: <br/> <input type="text" name="state"/> <br/> Zip Code: <br/> <input type="text" name="zip"/> <br/> Phone #: <br/> <input type="text" name="phone"/> <br/> E-Mail: <br/> <input type="text" name="email" /> <br/> Comment: <br/> <textarea rows="10" cols="80" wrap="physical" name="comments"> </textarea> <br/> <br/> <input type="submit" value="Send"> <input type="reset" value="Reset"> </form> What am i missing and how do i go about doing what i want? Thanks in advance!! I have another HTML form question....when I used http://www.forms4free.com, neither they nor Freedback have information about adding javascript for format, do you guys no of any good tutorials on Javascript for form validation? Hey, I am relatively new to html and had a quesiton concerning html forms. I am familiar with how to display the form on the site and have the user submit it, but how can i retrieve that data automatically (real time preferred) and post it on the page without doing anything else myself. specifically, how can i have a user input a link and have the html code automatically add it to a page? Any help would be appreciated. |