#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    2
    Rep Power
    0

    ISSUE with Buttons and Export/Save


    Hi Guys can someone please help me with buttons issue i need the buttons to be even and also if possible trying to export/save to excel the results and send email the results.

    Thank you.





    HTML4Strict Code:
    <html>
    	<head>
    	<body style="background-color:CCCC99;">
    	<script language="javascript">
    		function displayDate() {
    			document.getElementById("demo").innerHTML=Date();
    		}
    		function addone(field) {
    			field.value = Number(field.value) + 1;
    		}
    		var count=0;
    		function myFun(f) {
    			count += 1; f.myText.value = count;
    		}
    	</script>
    	</head>
    	<fieldset>
    		<legend><h2 style="color:336699;">Reason for:</h2></legend>
    		<table border="1">
    			<tr>
    				<td>
    					<table border="1">
    						<tr>
    							<th>..</th>
    							<th>...</th>
    						</tr>
    						<tr>
    							<td>
    								<form name="myform1">
    								<input type="text" name="myfield1" value="0" size="20"><br>
    							</td>
    							<td>
    								<input type="button" value="Name" onclick="addone(myfield1);">
    								</form>
    							</td>
    						</tr>
    						<tr>
    							<td>
    								<form name="myform2">
    								<input type="text" name="myfield2" value="0" size="20"><br>
    							</td>
    							<td>
    								<input type="button" value="DOB" onclick="addone(myfield2);"></form>
    							</td>
    						<tr>
    							<td>
    								<form name="myform3">
    								<input type="text" name="myfield3" value="0" size="20"><br>
    							</td>
    							<td>
    								<input type="button" value="ARH" onclick="addone(myfield3);"></form>
    							</td>
    						</tr>
    						<tr>
    							<td>
    								<form name="myform4">
    								<input type="text" name="myfield4" value="0" size="20"><br>
    							</td>
    							<td>
    								<input type="button" value="Adress" onclick="addone(myfield4);"></form>
    							</td>
    						</tr>
    						<tr>
    							<td>
    								<form name="myform5"> <input type="text" name="myfield5" value="0" size="20"><br>
    							</td>
    							<td>
    								<input type="button" value="Miss Information" onclick="addone(myfield5);"> </form>
    							</td>
    						</tr>
    						<tr>
    							<td>
    								<form name="myform6">
    								<input type="text" name="myfield6" value="0" size="20"><br>
    							</td>
    							<td>
    								<input type="button" value="10/Internet Record" onclick="addone(myfield6);"> </form>
    							</td>
    						</tr>
    						<tr>
    							<td>
    								<form name="myform7">
    								<input type="text" name="myfield7" value="0" size="20"><br>
    							</td>
    							<td>
    								<input type="button" value="Clames" onclick="addone(myfield7);"> </form>
    							</td>
    						</tr>
    						<tr>
    							<td>
    								<form name="myform8"> <input type="text" name="myfield8" value="0" size="20"><br>
    							</td>
    							<td>
    								<input type="button" value="Other" onclick="addone(myfield8);"> </form>
    							</td>
    						</tr>
    						<tr>
    							<td>
    								<form name="myform1">
    								<input type="text" name="myfield1" value="0" size="20"><br>
    							</td>
    							<td>
    								<input type="button" value="Other2" onclick="addone(myfield1);"> </form>
    							</td>
    						</tr>
    					</table>
    				</td>
    				<td>
    					<ul>
    						<li>Name - Both Customer</li>
    						<li>DOB - Both Customers</li>
    					</ul>
    				</td>
    			</tr>
    			<tr>
    				<td>Save to Excel</td>
    				<td>email</td>
    			</tr>
    		</table>
    	</fieldset>
    </html>
    Last edited by Winters; June 11th, 2013 at 06:02 AM. Reason: Added highlighting and indentation.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2009
    Posts
    310
    Rep Power
    162
    Please can you validate your code, there is a lot wrong there that can be causing all sorts of unexplained behaviour and issues.
    Also, if you wouldn't mind giving a link, just leave out the http://
    Quality European Web Hosting - LDHosting.com
    High Quality, Low Cost Web Hosting Services
    www.ldhosting.com
  4. #3
  5. No Profile Picture
    Super Moderator
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,009
    Rep Power
    2791
    As LDHosting has mentioned, there are a lot of basic issues with that HTML and Javascript code, which need to be addressed before moving ahead.
    • You are not declaring a document type or character set.
    • The language attribute in your script tag is deprecated. You should be using the type attribute.
    • You have put the body tag within the head tags and you have not closed the body tag.
    • You have forms with the same names.
    • You are using archaic HTML structures from the 90's.
    • You are not encapsulating the string arguments in your Javascript event calls.

    Run your code though the W3C Validator and have a look here to view a very short example of basic HTML structure.

    Comments on this post

    • LDHosting agrees : More in-depth explanation :)
    Last edited by Winters; June 11th, 2013 at 06:28 AM. Reason: URL typo
    [PHP] | [Perl] | [Python] | [Java] != [JavaScript] | [XML] | [C] | [C++] | [LUA] | [MySQL] | [FirebirdSQL] | [PostgreSQL] | [HTML] | [XHTML] | [CSS]

    W3Fools - A W3Schools Intervention.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    2
    Rep Power
    0
    i sorry guys i don't know HTML i found the HTML code online i needed a button click counter every time i would press on the button i would go up +1 i use it to count my work so i don't have to use tick marks on paper i used the code and saved it to my desktop( if someone can help make a 5 button click counter pls )

    you can copy and paste the code to hxxp://htmledit.squarefree.com/ what i need for work

    and the Result from hxxp://validator.w3.org/check 31 Errors, 4 warning(s)

    Thank you,

IMN logo majestic logo threadwatch logo seochat tools logo