Jump to content

Funce

Moderator
  • Posts

    602
  • Joined

  • Last visited

  • Days Won

    19

Posts posted by Funce

  1. A lot of these things that you've asked about will be unique to you unless you're working with enforced styling such a development team.

    Code wise, a lot of it looks good. Only things that I'll pick out it:

    • Try throwing your CSS into a separate file. It will unclutter the main HTML code, and you'll be able to reuse it for other pages.
    • In my opinion <br /> tags are kind of a crutch? They have their place but, most of the time, you'll be able to do better with CSS

    And on the note of the <br /> tags, one of them doesn't have an ending slash. This just looks like its been forgotten and it isn't make or break, however something that's really important is to be consistent across your tags. Your <a> tags inside the <footer> have spaces in between the href and = whereas the ones on your <aside> do not.

    Just the main thing is to be consistent.

    Have a look into the DRY principle. "Don't repeat yourself"

    • Like 1
  2. Has your Zapier whitelisted your first submission location? To prevent others from using it?

     

    "Thanks for your message!" Is this an alert? Like one you press OK on?

     

    What browser do you use? If chrome, try checking the network tab (in Developer Tools) with the 'preserve log' option set when you submit. And find the one which matches your Zapier URL. That might give you a little insight into what's going on. Whether its redirecting or doing anything in particular.

  3. 14 hours ago, s_avinash_s said:

    I used as suggested by Funce

    
    var v = document.forms["myForm"]["USUnits"].value;
    if (v == "") {
      alert("SMass flow unit selection must be selected");
      return false;
    }

    In this case when i select SI units or US units, They are not showing other drop down list.

    I can only see first drop down list not second one.

    Is this a new requirement?

    If not, I apologise for misunderstanding.

    What you'll need to do is bind an `onchange` event to a function which:

    • Checks the value of `v` (used in my example)
    • If its not "(empty)" then show the other dropdown list.
  4. 2 hours ago, JRJ said:

    Funce, what editor are you using to check the file for errors?

    Visual Studio Code. Although you would find out with any editor that has error checking for syntax errors.

    2 hours ago, JRJ said:

    thanks for the feedback. I'm trying to monitor a tag that resides on my data logger. When the tag changes states I want to change the color of my pivatic line display.

    Have you been able to communicate with the Data Logger? Or is your Data Logger more of a page preprocessor that would inject the values on page load?

  5. I apologise for the confusion. I'm referring to the contents of the file posted.

    This is what's currently defined as the style body.

    <style>
    	html, body {
    		height: 100%;
    		width:100%;
    		font-family:helvetica;
    		margin:0;
    		padding:0;
    		background-color: #000000;
    		color:white;
    	}
    	
    	.button {
    		position:absolute;
    		top:2.5vh;
    		border:0;
    		background: #0087cc;
    		border-radius: .3vw;
    		box-shadow: 0 .375vw 0 #006599;
    		color: #fff;
    		cursor: pointer;
    		font-size:1.2vw;
    		margin: 0;
    		outline: 0;
    		padding: .5vw .5vw;
    		transition: all .1s linear;
    	}
    	
    	.button:active {
    		box-shadow: 0 .15vw 0 #006599;
    		transform: translateY(3px);
    	}
    	
    	.displayBox {
    		width:49vw;
    		background-color:#008800;
    		margin:0 auto;
    		margin-bottom: 1.5vh;
    		border-radius:1vw;
    	}
    	
    	.header {
    		height:10vh;
    		border-top: 1px solid black; /* For some reason, without this, browsers will sometimes display scrollbars unnecessarily. Bad browsers. Bad. */
    		border-bottom: .4vw solid white;
    	}
    	
    	.displayTable {
    		margin:0 auto;
    		margin-left:1vw;
    		margin-right:1vw;
    		width:47vw;
    		font-size:2.4vw;
    	}
    	
    	.displayTable td {
    		width:21%;
    	}
    	
    	.displayTable td:nth-child(1) {
    		width:36%;
    	}
    	
    	.smallTable {
    		padding: .5vw 1vw;
    		font-size:2.4vw;
    		background-color:#0033cc;
    		border-radius:1vw;
    		width:100%;
    	}
    	
    	.smallTable td:nth-child(2) {
    		text-align:right;
    	}
    	
    	.statisticColumn {
    		width:49vw;
    	}
    	
    	.statisticParent {
    		position:absolute;
    		top:11vh;
    		width:100vw;
    		height:80%;
    	}
    	
    	.title {
    		border-radius: 1.5vw;
    		width: 40vw;
    		font-size: 3vw;
    		font-weight:bold;
    		margin: 0 auto;
    		margin-top: 1vh;
    		background-color:#0033cc;
    		border: 5px solid #3366ff;
    		text-align:center;
    	}
    	#a80, #a81, #a82, #a83, #a84, #a85, #a86, #a87, #a88, #a89 {
    		background-color: yellow;
    		color:black;
    	}
    	
    	#a0,#a1, #a2, #a3, #a4, #a5, #a6, #a7, #a8, #a9,
    	#a10, #a11, #a12, #a13, #a14, #a15, #a16, #a17, #a18, #a19,
    	#a20, #a21, #a22, #a23, #a24, #a25, #a26, #a27, #a28, #a29,	
    	#a30, #a31, #a32, #a33, #a34, #a35, #a36, #a37, #a38, #a39,
    	#a40, #a41, #a42, #a43, #a44, #a45, #a46, #a47, #a48, #a49,
    	#a50, #a51, #a52, #a53, #a54, #a55, #a56, #a57, #a58, #a59,
    	#a60, #a61, #a62, #a63, #a64, #a65, #a66, #a67, #a68, #a69,
    	#a70, #a71, #a72, #a73, #a74, #a75, #a76, #a77, #a78, #a79 {
    		background-color: red;
    	}
    <script= text/javascript>
    	var StopTimePivatic = [[175]];
    	if (StopTimePivatic != 0){
    		#b[[141]]{
    		style.background-color= silver;
    		}
    	}
    	else{
    		#b80, #b81, #b82, #b83, #b84, #b85, #b86, #b87, #b88, #b89, #b90 {
    		style.background-color = Yellow;
    		style.color = black;
    		}
    		
    		#b0, #b1, #b2, #b3, #b4, #b5, #b6, #b7, #b8, #b9,
    		#b10, #b11, #b12, #b13, #b14, #b15, #b16, #b17, #b18, #b19,
    		#b20, #b21, #b22, #b23, #b24, #b25, #b26, #b27, #b28, #b29,	
    		#b30, #b31, #b32, #b33, #b34, #b35, #b36, #b37, #b38, #b39,
    		#b40, #b41, #b42, #b43, #b44, #b45, #b46, #b47, #b48, #b49,
    		#b50, #b51, #b52, #b53, #b54, #b55, #b56, #b57, #b58, #b59,
    		#b60, #b61, #b62, #b63, #b64, #b65, #b66, #b67, #b68, #b69,
    		#b70, #b71, #b72, #b73, #b74, #b75, #b76, #b77, #b78, #b79 {
    			style.background-color = red;
    		}
    	}
    </script>
    </style>

     

    When I pass it through my editor, numerous errors are thrown. The Javascript is using CSS selectors, with Javascript commands. Its quite... interesting.

  6. Just now, Html said:

    The example has two first_name in the book.

    I wouldn't have an answer for why that is. Have you read further? Is it a chapter on error checking? I know some examples in books do that on purpose to teach the value of debugging errors. I have a C# book that did just that.

  7. I didn't read it too thoroughly. It might've been a transcription error.

    CREATE TABLE IF NOT EXISTS forum(
      post_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
      first_name VARCHAR(20) NOT NULL,
      last_name VARCHAR(40) NOT NULL,
      subject VARCHAR(60) NOT NULL,
      message TEXT NOT NULL,
      post_date DATETIME NOT NULL,
      PRIMARY KEY (post_id)
    )

    Try this. It doesn't have multiple `first_name` columns.

  8. Where are you pasting this code? That error doesn't look like a PHP error. (Which I'm assuming that is being written in)

     

    If you've pasted that in directly to phpMyAdmin for instance, you'll need to try something like this instead. Please let me know how it goes!

    CREATE TABLE IF NOT EXISTS forum(
      post_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
      first_name VARCHAR(20) NOT NULL,
      last_name VARCHAR(40) NOT NULL,
      first_name VARCHAR(20) NOT NULL,
      subject VARCHAR(60) NOT NULL,
      message TEXT NOT NULL,
      post_date DATETIME NOT NULL,
      PRIMARY KEY (post_id)
    )

     

  9. I'm hoping this is a snippet, I couldn't get this to run originally, but you said you could so no matter.

     

    Try adding a value to the Select Option, and then check if that is the option currently selected.

    <select id='opt2' name='USUnits' onchange="showForm1()">
      <option value="">Select Option</option>
      <option value="0">Lbs/Sec</option>
      <option value="1">Lbs/min</option>
    </select>

    Then it would be as simple as

    var v = document.forms["myForm"]["USUnits"].value;
    if (v == "") {
      alert("SMass flow unit selection must be selected");
      return false;
    }

     

    I highly recommend you use more descriptive variable and field names. It was a little hard impossible to follow the jq, jjq, jqq, ojq, and what they meant without checking the definitions of them.

    • Like 1
  10. I'm not sure very many browsers have the capacity to run JavaScript inside CSS.

    Does this otherwise work with any verbose commands like Alert or Console.Log?

     

    <script> tags have no meaning inside <style> tags. Not to mention that the 'JavaScript' you have written is of totally the wrong format.

    What are you attempting to achieve here?

  11. I've had a look through and its the variations on handling between `color`, `text-shadow` and  `background-clip`

    I noticed that some browsers handle their styling groupings differently. Its illustrated clearly with the discrepancy between Chrome, Edge, and Internet Explorer.

    Internet Explorer doesn't obey `background-clip: text`. Hence you can't see the text at all.

    Take a peek at https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip to check for compatibility.

    Edge groups its opacity for its `text-shadow` with that of its normal `color` hence when you use `transparent` it makes the shadow transparent also. It does however obey `background-clip` so you can still see the text.

    Chrome seems to keep all of them separate with none affecting the others.

     

    If you wish to support these browsers you might want to look into browser specific styling.

  12. It looks like to me you're missing a `float: none;` for that section that you're referring to. 

    The specific spot you're looking for is
    gc_template.css - Line 112

    #middle {
      width: auto;
      width: -moz-auto;
      margin-left: 0px;
      float: none; /* Add this */
    }

     

    From my end, this looks like it works. Feel free to let me know if it does not.

     

    This section, in particular, was escaping the page wrapper, making me think there was some alignment or flex going on. I was not incorrect.

    • Like 1
  13. Can confirm, your issue stems from using `mysqli_real_escape_string`. That function just half-protects your queries from any anomalous characters, by escaping them, that may end up executing unwanted things. Not particularly useful in any case.

    Any special characters inside that function are taken literally `\r\n` rather than as they're supposed to be which is a Carriage Return and LineFeed Character. (Basically new line)

     

    In this case you won't even need to use mysqli_real_escape_string. You're not putting the data into the database are you? If you are I suggest reading up on 'Prepared Statements'.

  14. If you've already managed to pull the RSS feed, and you know WHERE to get this XML from on your local file system(or otherwise), what you want is to find out how Python can parse XML strings/files for you. 

    Just note that the inbuilt abilities of python are vulnerable to maliciously constructed XML so I recommend checking some of these out.

    For Python3:

    https://docs.python.org/3/library/xml.html

    https://pypi.org/project/defusedxml/

     

    You seem pretty onto things, so don't hesitate to ask questions. There are loads of knowledgeable people here.

    Welcome to the W3Schools Forum!

    • Thanks 1
  15. May I recommend using the code block ability of the Forums.

    image.png.6c028de7ed9e881c065d45151b47f6c7.png

    It'll be able to colour and structure your code to be a whole lot more readable.

    --

    If you want to add 'More box' in regards to filling the rest of the page, you'll need to change the styling for it to do so. Try experimenting with height. You might be able to get somewhere with that.

     

    If you want to add ANOTHER box underneath that navigation box, put the HTML code for another box in underneath the nav box, then surround both boxes in a <div> tag. I've copied the navigation box again for this example.

    image.thumb.png.9b2378ac4ff0b13d78d613d2574612a8.png

×
×
  • Create New...