I found this: One way would be to set the "disabled" attribute on those fields, which prevents their values from being serialized and sent to the server: $(function() { $("form").submit(function() { $(this).children(':input[value=""]').attr("disabled", "disabled"); return true; // ensure form still submits } }); If you have client-side validation, you'll also want to re-enable these fields in the event of a validation failure: $(':input').removeAttr("disabled"); On 5/27/12 2:00 AM, "freepages-help-request@rootsweb.com" <freepages-help-request@rootsweb.com> wrote: Message: 1 Date: Sat, 26 May 2012 17:13:39 -0500 From: "Roger Hendrix" <rphendrix@windstream.net> Subject: [FreeHelp] Javascript to remove blank/empty fields form html form To: <freepages-help@rootsweb.com> Message-ID: <000001cd3b8c$cdf7ed10$69e7c730$@windstream.net> Content-Type: text/plain; charset="us-ascii" I am looking for a working fully functional JavaScript that will remove blank/empty fields from an html form before the form submit function sends the form on the it's final destination. Consider the Family Group Sheet found at the following: http://freepages.genealogy.rootsweb.ancestry.com/~gearyfamily/family-group- s heet.html I was considering using the form; however, I would like to receive the only the fields that were filled in by the sender. Yes, I have searched the internet using Google (sorry Bing). I have found many examples; however, none were working functional scripts.
Roger asked: "I am looking for a working fully functional JavaScript that will remove blank/empty fields from an html form before the form submit function sends the form on the it's final destination." A worthy goal. However, I think a list or forum specializing in javascript could be a better place to ask. There are several places where you can find CheckForm() function coding for javascript. These functions in the code libraries typically check required fields and send the user back to the empty field before submitting the form. (This doesn't seem to be what you want, but there may be lessons in the code.) Terminology: In the HTML form, the data sits in a "field"; the javascript counterpart is called a "variable". I suspect you'll need to create a variable "array" (variable consisting of more than one other variable), check if fields are empty, then delete the empty fields from the final array before processing further. -rt_/)
Pat: Thanks for the response. I understand about the mailmerge template. So, I did some more searching and found that I can use the action="mailto:someone@somewhere.com" instead of pointing to the mailmerge cgi. This works; however, I still have the problem of getting all of the blank fields. The JavaScript that I found on the internet that is supposed to strip the blank/empty fields follows: ======================================================= function removeBlankFields() { var i, x; var inputs = document.getElementsByTagName("input"); var removeList = new Array(); for (i = 0; i < inputs.length; i++) { if (inputs[i].value = ""); { removeList.push(inputs[i]); } } for (x in removelist) { removeList[x].parentNode.removeChild(removeList[x]); } } ============================================ This function is called from by the form using the onsubmit function: <form onsubmit="removeBlankFields()" action="mailto:rphendrix1@gmail.com" method="post" enctype="application/x-www.form-urlencoded"> However, this does not remove the blank/empty fields before submitting the form is submitted! So, can someone out there point me in the right direction? Roger Hendrix -----Original Message----- From: Pat Asher [mailto:pjroots@att.net] Sent: Sunday, May 27, 2012 7:42 AM To: Roger Hendrix Cc: freepages-help@rootsweb.com Subject: Re: [FreeHelp] Javascript to remove blank/empty fields form html form At 06:13 PM 5/26/2012, Roger Hendrix wrote: >I am looking for a working fully functional JavaScript that will remove >blank/empty fields from an html form before the form submit function >sends the form on the it's final destination. >Consider the Family Group Sheet found at the following: >http://freepages.genealogy.rootsweb.ancestry.com/~gearyfamily/family-gr >oup-s >heet.html >I was considering using the form; however, I would like to receive the >only the fields that were filled in by the sender. If you are using Mailmerge to send an output file, the output is controlled by the template, which does not recognize whether something has been entered in a field. It sends all fields it has been scripted to send, whether they contain an entry or not. Pat Asher
At 06:13 PM 5/26/2012, Roger Hendrix wrote: >I am looking for a working fully functional JavaScript that will remove >blank/empty fields from an html form before the form submit function sends >the form on the it's final destination. >Consider the Family Group Sheet found at the following: >http://freepages.genealogy.rootsweb.ancestry.com/~gearyfamily/family-group-s >heet.html >I was considering using the form; however, I would like to receive the only >the fields that were filled in by the sender. If you are using Mailmerge to send an output file, the output is controlled by the template, which does not recognize whether something has been entered in a field. It sends all fields it has been scripted to send, whether they contain an entry or not. Pat Asher
I am looking for a working fully functional JavaScript that will remove blank/empty fields from an html form before the form submit function sends the form on the it's final destination. Consider the Family Group Sheet found at the following: http://freepages.genealogy.rootsweb.ancestry.com/~gearyfamily/family-group-s heet.html I was considering using the form; however, I would like to receive the only the fields that were filled in by the sender. Yes, I have searched the internet using Google (sorry Bing). I have found many examples; however, none were working functional scripts.
At 09:53 AM 5/25/2012, you wrote: >Changed it to be: > >/home/httpd/cgi-bin/mailmerge.cgi: Specified log file >'/u1/e/l/s/i/rogerhendrix/genealogy_html/append-msg-query.shtml' does not >exist. It must already be created and writable. > >And still get the error? >Do I have the file address wrong? Yes. It should be "/u1/r/o/g/e/rogerhendrix/genealogy_html/append-msg-query.shtml" Pat Asher
I am trying to append a message to a local html file using the following page: http://freepages.genealogy.rootsweb.ancestry.com/~rogerhendrix/append-msg-fi le.shtml The target page is: http://freepages.genealogy.rootsweb.ancestry.com/~rogerhendrix/append-msg-qu ery.shtml It processes thru the Mailmerge gateway to the point that it tries to find the output file where I get the following message: Note: I found that this was wrong: /home/httpd/cgi-bin/mailmerge.cgi: Specified log file '/u1/e/l/s/i/rogerhendrix/computers_html/append-msg-query.shtml' does not exist. It must already be created and writable. Changed it to be: /home/httpd/cgi-bin/mailmerge.cgi: Specified log file '/u1/e/l/s/i/rogerhendrix/genealogy_html/append-msg-query.shtml' does not exist. It must already be created and writable. And still get the error? Do I have the file address wrong? Are the file attributes wrong? I have used the Rootsweb File Manager and set the attributes of the file to be: -rw-rw-rw Please advise. Many thanks in advance. Roger Hendrix
I am trying to append a message to a local html file using the following page: http://freepages.genealogy.rootsweb.ancestry.com/~rogerhendrix/append-msg-fi le.shtml The target page is: http://freepages.genealogy.rootsweb.ancestry.com/~rogerhendrix/append-msg-qu ery.shtml It processes thru the Mailmerge gateway to the point that it tries to find the output file where I get the following message: /home/httpd/cgi-bin/mailmerge.cgi: Specified log file '/u1/e/l/s/i/rogerhendrix/computers_html/append-msg-query.shtml' does not exist. It must already be created and writable. Do I have the file address wrong? Are the file attributes wrong? I have used the Rootsweb File Manager and set the attributes of the file to be: -rw-rw-rw Please advise. Many thanks in advance. Roger Hendrix
At 09:55 AM 5/24/2012, Roger Hendrix wrote: >Greetings: > >Thanks to Barry Carlson and Jill Muir for the assist. I did use their >suggestions and made improvements on the look of the web page. > >Changing the color scheme helped clean up the remaining margin differences. > >Again, Many thanks to Jill and Barry for taking the time to review and >respond to my request. ==================== Roger, glad you got some help in getting the problem fixed. I was just too tired to even try. The one suggestion I would make is to INCREASE the size of your text content and the top menu. I really have to increase the size of the font to even begin to be able to read it. Pat
Back in January 2012, I made mention of advances in CSS3 being implemented in Webkit browsers, i.e. Google Chrome, Safari and the Mac O/S browser Omniweb. I made the point that creating your own designed headings using the many special free fonts that can be found at sites such as - http://fontsquirrel.com - is truely possible. Up until recently web fonts could be colored, but not made transparent or receive any other type of fill such as an image. That has all changed, and without the aid of Photoshop you can create stunning headings that allow an image or a "linear/radial-gradient" design to be the "fill" for your font color. My original post can be found here:- http://archiver.rootsweb.com/th/read/Freepages-Help/2012-01/1326320003 A recent test page I made uses the CSS3 "radial-gradient" property to provide the fill for the Kingsthings Petrock font, and the same page uses a "radial-gradient / linear-gradient" background. Once again, if you are not using a recent Webkit browser, an image will be substituted for the CSS your browser doesn't understand, and you'll see a note to that effect. The "box-shadow" property has been implemented round the content div and the color of that shadow has been declared in rgba format, where the "a" is the alpha or opacity value that helps make the rendered shadow more realistic. http://countjustonce.com/css3-gradients.html If you check the code, you'll find I've used a mixture of color formats and have found the following site provides an easy to use generator capable of output in any of the standard formats. http://www.workwithcolor.com/hsl-color-picker-01.htm Finally, a complex graphic [TV Test Card] produced using HTML / CSS3 techniques results in a total page load of 2KB, and this includes a few extra bytes covering meta content plus keyword descriptions. Note there is no Javascript or jQuery in this final version, and the original table creating the white grid on a near black background has gone in favour of a "linear-gradient" background. This renders correctly in all the modern browsers including IE10, but progessively degrades (badly) in older versions of IE. Those of you who have IE9 installed will be able to click F12 and select the browser version from the top bar of the drop-down menu. You will note some differences as you go back to IE7. Don't forget to reselect IE9 after experimenting! However, the page uses some SSI browser detection and has provision to show a .png image if requested. Note, the image is not loaded during the page load, being loaded on clicking the 'View Image' button via an Iframe. http://countjustonce.com/test-pattern/index.html Whereas the same graphic captured as a .png image of 800 by 600 pixels and loaded into a basic HTML5 page, results in a total page load of about 48KB. Fit for all browsers :-) http://countjustonce.com/test-pattern/zl-image.html So its quite clear that images are costly regarding bandwidth, and a good quality mixed text and images PDF file will probably result in a page load about 10 times that of the same page using HTML / CSS. Barry
As mentioned in my earlier post, here is the SSI content of the page I posted. SSI is capable of handling quite complex conditional expressions where a question is posed and if TRUE a result is given, but if FALSE a further question is asked, etc.. and if no result is forthcoming a default outcome will result. In the example below, we are looking to add the class="ieOld" to the <html> tag IF the browser identifies as MSIE 5 through 9. If that expression is TRUE, <html class="ieOld"> is inserted by the server and the expression ends. If the initial expression was FALSE then using ELIF (else-if) a test is now made for MSIE 10 or greater. If that expression is TRUE, <html class="ieNew"> is inserted by the server and the expression ends. If neither of the previous attempts were TRUE, the expression jumps to ELSE and inserts the default value of <html>. The same applies to the second expression which inserts the appropriate statement plus the browser User-Agent in the body of the page. As we use HTTP_USER_AGENT often, it has been SET as a variable, i.e. #set var="uA" value="$HTTP_USER_AGENT". In the first expression we check the the HTTP_USER_AGENT for MSIE 5 - 9 and as we are using regular expressions the string we are looking for is between the / and /. The numbers that will match can be any values that fall within the range [5-9], or in the case of the second expression, a number matching 10 or greater - [{10,}]. <!--#set var="uA" value="$HTTP_USER_AGENT" --> <!--#if expr="($uA=/MSIE [5-9]/)" --> <html class="ieOld"> <!--#elif expr="($uA=/MSIE [{10,}]/)" --> <html class="ieNew"> <!--#else --> <html> <!--#endif --> <!--#if expr="($uA=/MSIE [5-9]/)" --> This browser is an Internet Explorer version between 5 and 9 <!-#echo var="uA" --> <!--#elif expr="($uA=/MSIE [{10,}]/)" --> This browser is Internet Explorer version 10 or newer <!-#echo var="uA" --> <!--#else --> This browser is NOT an Internet Explorer version <!-#echo var="uA" --> <!--#endif --> The actual source code for the page is here:- http://freepages.rootsweb.com/~bristowe/ssi-demo-code.html - and you can copy & paste into a text editor and save with a filename of your choice. Unless you have a local Apache server, you will need to place it on a server running SSI to check it works. If you want your source code not to show blank lines where SSI data has been inserted, you will need to make all the code within an expression appear as one line. Most good text editors will show it as a single line number if you have organized it correctly. The working file is here:- http://freepages.rootsweb.com/~bristowe/ssi-test.html Barry
Greetings: Thanks to Barry Carlson and Jill Muir for the assist. I did use their suggestions and made improvements on the look of the web page. Changing the color scheme helped clean up the remaining margin differences. Again, Many thanks to Jill and Barry for taking the time to review and respond to my request. Best Regards, Roger Hendrix
On Wednesday, May 23, 2012 5:43 PM (UTC+12) Subject: [FreeHelp] Style Sheet (CSS) question? Roger wrote:- > > My question is: What is causing the white space above the top navigation > bar and below the banner; also, grey space below the banner and above the > white space above the top navigation bar? > ------------------------ Roger In the <div id="topNavigation">, remove the <center></center> tags from around the <form> tag and add to your styles - #topNavigation form { text-align:center; } Pat has suggested that rather than using the <form> you use an unordered list, but in the meantime the above will do. Also make the following changes to your styles - #banner { height: 112px; } #outerWrapper #topNavigation { margin-top:-2px; } I think I have covered everything, though I did notice the odd "?" in front of some of your divs. Perhaps you added those for checking purposes? Barry
Ten days ago, Ronald Mesnard wrote, " ... do not expect half the browsers to work unless your server hosts PHP and you present HTML targeted for the specific browser...", which is a point that needs clarification. PHP is not needed to target specific browsers, and in any case it is not available on the Rootsweb servers. However, Server Side Includes (SSI) is, and can be used to modify the content of a page in such a way that examination of the source code will give you no clue that the page you are viewing was modified at the server when it detected the User-Agent of the browser making the page request. It is also possible to load a page with Internet Explorer Conditional Comments when required, but they are only operated on by the particular browser parsing them and the code is viewable in the source of any other browser. With CSS it is possible to easily provide for Internet Explorer variances in IE5 through IE9 by creating an HTML class for each of the IE browsers you need to target, e.g. <!document html> <!--[if lt ie 6]><html class="ie5"><![endif]--> <!--[if ie 6]><html class="ie6"><![endif]--> <!--[if ie 7]><html class="ie7"><![endif]--> <!--[if ie 8]><html class="ie8"><![endif]--> <!--[if ie 9]><html class="ie9"><![endif]--> <!--[if !IE]><!--><html><!--<![endif]--> <head> etc... Which allows you to serve all your CSS in one file. Anything that needs targetting just has the class added to it, e.g. #content {width:800px;padding:20px;} .ie5 #content {width:840px;} Now lets go back to the SSI method, and though the code may look a little complex, there is no sign of that when your browser gets the right page to parse. An example of that is a very simple page designed to deliver a navy background and specific text for IE 5 through 9 browsers, a yellow background and specific text for IE10 and future IE browsers, and a pale green background with specific text for NON IE browsers. http://freepages.rootsweb.com/~bristowe/ssi-test.html For those that have IE10 preview and IE9, they will be able to check the outcome in each browser then do likewise in Firefox, Opera or Chrome. Make sure you check the source code each time! I'll post the page code including the SSI conditional expressions used later. Barry
On Wednesday, May 23, 2012 7:33 AM (UTC+12) Ralph Taylor wrote:- > Just saw this item in today's LinkedIn newsletter: > > "Google Chrome Just Passed Internet Explorer To Become The World's Most > Popular Web Browser > --------------------- Ralph, Do you wish you had bought Google shares? [:-) --------------------- Greg wrote:- >I don't care about browser wars, I don't care about browsers. > My main focus is genealogy, so my site is plain, simple. --------------------- Greg, Well you wont acquire genealogical information on this Rootsweb FreeHelp list. It is dedicated to helping those wishing to develop their own webpages, which is something you obviously have no need of. Barry
At 01:43 AM 5/23/2012, Roger Hendrix wrote: >http://freepages.genealogy.rootsweb.ancestry.com/~rogerhendrix/ > >Please ignore the color scheme. I added the colors to help me see what >effects my changes were having on the page layout. > >The web site layout & CSS was patterned from the "Baubles" Template found at >CSS Based Layout Templates - Genealogy Computer Tips ><http://freepages.genealogy.rootsweb.ancestry.com/~gearyfamily/templates.htm > >I did take some liberties; however, I tried very hard to not lose the layout >and formatting. ================ Roger, hopefully someone can take a look at it today and tell you what is wrong. My husband is back in the hospital so I am spending my days there. I will try and look at it tonight to see what is going on. I do wonder why you are using a form for the menu?? A styled list would work better. Just one of many http://matthewjamestaylor.com/centered-menus/ Pat
I don't care about browser wars, I don't care about browsers. My main focus is genealogy, so my site is plain, simple. All I want to do is put the information out there so that it either helps other people doing some research or they can help me. Greg On 23/05/2012 5:33 AM, Ralph Taylor wrote: > Just saw this item in today's LinkedIn newsletter: > > "Google Chrome Just Passed Internet Explorer To Become The World's Most > Popular Web Browser > > -- DAVIS Genealogy Blog - http://davisgenealogyproject.blogspot.com
I have loaded at Family web site at the following: http://freepages.genealogy.rootsweb.ancestry.com/~rogerhendrix/ Please ignore the color scheme. I added the colors to help me see what effects my changes were having on the page layout. The web site layout & CSS was patterned from the "Baubles" Template found at CSS Based Layout Templates - Genealogy Computer Tips <http://freepages.genealogy.rootsweb.ancestry.com/~gearyfamily/templates.htm l> I did take some liberties; however, I tried very hard to not lose the layout and formatting. My question is: What is causing the white space above the top navigation bar and below the banner; also, grey space below the banner and above the white space above the top navigation bar? Many thanks in advance. Roger Hendrix
At 07:06 PM 5/22/2012, Barry Carlson wrote: > >I don't care about browser wars, I don't care about browsers. > > My main focus is genealogy, so my site is plain, simple. ==================== Sites can be plain and simple BUT if they do not display in the browser your viewer has chosen to use - and it may not be the one you use to view the site - then all of the information in the world will do them no good. And believe me I have seen my share of sites where content and images display on top of each other so it is not legible. Pat
Just saw this item in today's LinkedIn newsletter: "Google Chrome Just Passed Internet Explorer To Become The World's Most Popular Web Browser "businessinsider.com - After months of chipping away at its lead, Google Chrome has finally overtaken Internet Explorer to become most popular web browser worldwide. Chrome's share of the market rose to 32.8% in the week ending May 20, while Internet..." Story continues at http://www.businessinsider.com/google-overtakes-internet-explorer-as-most-po pular-browser-2012-5?utm_source=twitterfeed&utm_medium=twitter&utm_campaign= Feed%3A+businessinsider+%28Business+Insider%29 where this sentence appears, "Mozilla's Firefox is the third most popular browser with just more than a 25% of the market." An included graph shows IE & Firefox use declining from 2011, while Chrome increases; Opera holds steady at about 2%, and "other" browsers increase from about 5% to 8%. Something, I suppose, for us to keep in mind as we develop our sites. -rt_/) PS -- A separate LinkedIn item states that only 19% of employees are satisfied with their jobs. More food for thought?