Can I get some HTML code for this attached Image | Member | | Join Date: Oct 2009
Posts: 120
| | |
Can I get some HTML/CSS code for this attached Image. I need just Two lines, but I should be able to select only one line (if I select Second line, it should throw warning like "select one port and click apply". I need status like
PLUG1 O ON O OFF PLUG 1 Status ^00&0001 | ON | OFF |;
PLUG2 O ON O OFF PLUG 2 Status ^00&0002 | ON | OFF |;
appreciated.
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 3,664
| | | re: Can I get some HTML code for this attached Image
if you show me what you have managed so far, I can tell you, whether you’re on the right path.
| | Member | | Join Date: Oct 2009
Posts: 120
| | | re: Can I get some HTML code for this attached Image
Thanks for help. I got this. I don't know how to put that title. also I want to select only one plug at a time, I need some warning if I second plug. -
<!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>
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
<title>:: SWITCH PANEL</title>
-
<style>
-
html,body{
-
margin-top:0px;
-
margin-bottom:0px;
-
margin-right:0px;
-
margin-left:0px;
-
background-color:#FFFFFF;
-
font-family:Verdana, Arial, Helvetica, sans-serif;
-
font-size: 11px;
-
color:#000000;
-
}
-
.text {
-
font-family:Verdana, Arial, Helvetica, sans-serif;
-
font-size:12px;
-
color:#333333;
-
font-weight:bold;
-
border-bottom:1px solid #FF9900;
-
}
-
.on_text {
-
font-family:Verdana, Arial, Helvetica, sans-serif;
-
font-size:12px;
-
color:#00CC33;
-
font-weight:bold;
-
border-bottom:1px solid #FF9900;
-
}
-
.off_text {
-
font-family:Verdana, Arial, Helvetica, sans-serif;
-
font-size:12px;
-
color:#CC0000;
-
font-weight:bold;
-
border-bottom:1px solid #FF9900;
-
}
-
.on_button {
-
border:0px solid #00CC00;
-
background-color:#00CC00;
-
color:#FFFFFF;
-
font-size:12px;
-
font-weight:bold;
-
}
-
.off_button {
-
border:0px solid #FF0000;
-
background-color:#FF0000;
-
color:#FFFFFF;
-
font-size:12px;
-
font-weight:bold;
-
}
-
.line
-
{
-
border-bottom:1px solid #FF9900;
-
}
-
</style>
-
<script language="javascript">
-
function refreshPage()
-
{
-
location.href="plugv1.htm";
-
}
-
function submit_Confirm(id)
-
{
-
var stat = confirm("Are you sure you want to Submit ?");
-
if(stat!="")
-
{
-
document.sp.submit();
-
}
-
else
-
{
-
}
-
}
-
function logout_Confirm()
-
{
-
var stat = confirm("Are you sure you want to Logout ?");
-
if(stat!="")
-
{
-
// Logout logic and page to be re -direct
-
}
-
else
-
{
-
}
-
}
-
</script>
-
-
</head>
-
<body>
-
<!-- end --></td></tr></table>
-
<br />
-
<!-- <form name="sp" method="post" action=""> -->
-
<form name="input" action="/plugv1.htm" method="get">
-
<table align="center" cellpadding="10" cellspacing="0" style="border:2px solid #FF9933;" border="0">
-
<tr bgcolor="#FFF5EB">
-
<td class="text" align="left">PLUG 1</td>
-
<td class="on_text" align="left"><input type="radio" name="plug1" value="ON1">ON</td>
-
<td class="off_text" align="left"><input type="radio" name="plug1" value="OF1">OFF</td>
-
<td class="text" align="left">PLUG 1 Status</td>
-
<td class="text" align="left">^00&0001 </td>
-
<td class="line"> | <input type="button" class="on_button" value=" ON " /> |</td>
-
<td class="line"><input type="button" class="off_button" value=" OFF " /> |;</td>
-
</tr>
-
<tr bgcolor="#FFEBD2">
-
<td class="text" align="left">PLUG 2</td>
-
<td class="on_text" align="left"><input type="radio" name="plug2" value="ON2">ON</td>
-
<td class="off_text" align="left"><input type="radio" name="plug2" value="OF2">OFF</td>
-
<td class="text" align="left">PLUG 2 Status</td>
-
<td class="text" align="left">^00&0002 </td>
-
<td class="line"> | <input type="button" class="on_button" value=" ON " /> |</td>
-
<td class="line"><input type="button" class="off_button" value=" OFF " /> |;</td>
-
</tr>
-
<tr bgcolor="#FFF5EB">
-
<td class="text" align="left">PLUG 3</td>
-
<td class="on_text" align="left"><input type="radio" name="plug3" value="ON3">ON</td>
-
<td class="off_text" align="left"><input type="radio" name="plug3" value="OF3">OFF</td>
-
<td class="text" align="left">PLUG 3 Status</td>
-
<td class="text" align="left">^00&0004 </td>
-
<td class="line"> | <input type="button" class="on_button" value=" ON " /> |</td>
-
<td class="line"><input type="button" class="off_button" value=" OFF " /> |;</td>
-
</tr>
-
<tr bgcolor="#FFEBD2">
-
<td class="text" align="left">PLUG 4</td>
-
<td class="on_text" align="left"><input type="radio" name="plug4" value="ON4">ON</td>
-
<td class="off_text" align="left"><input type="radio" name="plug4" value="OF4">OFF</td>
-
<td class="text" align="left">PLUG 4 Status</td>
-
<td class="text" align="left">^00&0008 </td>
-
<td class="line"> | <input type="button" class="on_button" value=" ON " /> |</td>
-
<td class="line"><input type="button" class="off_button" value=" OFF " /> |;</td>
-
</tr>
-
<tr bgcolor="#FFF5EB">
-
<td class="text" align="left">PLUG 5</td>
-
<td class="on_text" align="left"><input type="radio" name="plug5" value="ON5">ON</td>
-
<td class="off_text" align="left"><input type="radio" name="plug5" value="OF5">OFF</td>
-
<td class="text" align="left">PLUG 5 Status</td>
-
<td class="text" align="left">^00&0010 </td>
-
<td class="line"> | <input type="button" class="on_button" value=" ON " /> |</td>
-
<td class="line"><input type="button" class="off_button" value=" OFF " /> |;</td>
-
</tr>
-
<tr bgcolor="#FFEBD2">
-
<td class="text" align="left">PLUG 6</td>
-
<td class="on_text" align="left"><input type="radio" name="plug3" value="ON6">ON</td>
-
<td class="off_text" align="left"><input type="radio" name="plug3" value="OF6">OFF</td>
-
<td class="text" align="left">PLUG 6 Status</td>
-
<td class="text" align="left">^00&0020 </td>
-
<td class="line"> | <input type="button" class="on_button" value=" ON " /> |</td>
-
<td class="line"><input type="button" class="off_button" value=" OFF " /> |;</td>
-
</tr>
-
<tr bgcolor="#FFF5EB">
-
<td class="text" align="left">PLUG 7</td>
-
<td class="on_text" align="left"><input type="radio" name="plug7" value="ON7">ON</td>
-
<td class="off_text" align="left"><input type="radio" name="plug7" value="OF7">OFF</td>
-
<td class="text" align="left">PLUG 7 Status</td>
-
<td class="text" align="left">^00&0040 </td>
-
<td class="line"> | <input type="button" class="on_button" value=" ON " /> |</td>
-
<td class="line"><input type="button" class="off_button" value=" OFF " /> |;</td>
-
</tr>
-
<tr bgcolor="#FFEBD2">
-
<td class="text" align="left">PLUG 8</td>
-
<td class="on_text" align="left"><input type="radio" name="plug8" value="ON8">ON</td>
-
<td class="off_text" align="left"><input type="radio" name="plug8" value="OF8">OFF</td>
-
<td class="text" align="left">PLUG 8 Status</td>
-
<td class="text" align="left">^00&0080 </td>
-
<td class="line"> | <input type="button" class="on_button" value=" ON " /> |</td>
-
<td class="line"><input type="button" class="off_button" value=" OFF " /> |;</td>
-
</tr>
-
</table>
-
<br />
-
<table width="253" border="0" align="center" cellpadding="5" cellspacing="0" style="border:1px solid #FF9900;" bgcolor="#FFF5EB">
-
<td class="text">ALL PLUGS </td>
-
<td class="on_text"><input type="radio" name=plugx value="ONX"/>ON </td>
-
<td class="off_text"><input type="radio" name=plugx value="OFX">OFF </td>
-
</table>
-
<br />
-
<table width="474" border="0" align="center" cellpadding="5" cellspacing="0" style="border:0px solid #FF9900;">
-
<td align="left"><input type="submit" value="Submit" onclick="submit_Confirm();"/></td>
-
<td align="center"><input type="reset" value=" Clear " /></td>
-
<td align="right"><input type="button" value="Refresh" onClick="refreshPage();"/></td>
-
</table>
-
<br />
-
<table width="474" border="0" align="center" cellpadding="5" cellspacing="0" style="border:0px solid #FF9900;">
-
<td align="center"><input type="button" value=" Logout " onclick="logout_Confirm();"/></td>
-
</table>
-
</form>
-
<!-- end --></td></tr></table>
-
<br />
-
</body>
-
</html>
-
-
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 3,664
| | | re: Can I get some HTML code for this attached Image
there are 2 possibilities to check only one "ON" radio
1) give all the "ON" radios the same name, this way you cannot select more than one. use javascript to match the "OFF" radios - // for each line, e.g. using class
-
// somewhat pseudo code
-
if (false == ON.checked)
-
OFF.checked = true;
-
else
-
OFF.checked = false;
2) pair the "ON" and "OFF" radios, check all radios to "OFF" and only the current one (back) to "ON"
there are various ways to implement each of the ideas.
| | Member | | Join Date: Oct 2009
Posts: 120
| | | re: Can I get some HTML code for this attached Image
If I give the same name, I need to pass name, its value to server, that tells microcontroller to make high or low that particular GPIO pin.
Can I get some html code for header?. I put the header info in image file I attached in first message
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 3,664
| | | re: Can I get some HTML code for this attached Image Quote:
Originally Posted by tvnaidu If I give the same name, I need to pass name, its value to server the browser does that for you. Quote:
Originally Posted by tvnaidu Can I get some html code for header?. I put the header info in image file I attached in first message what header?
if you speak of HTTP headers, you should not set them yourself (unless you have very good (or evil) reason to)
if you speak of HTML <meta> elements in the <head>, they are for the browser only
| | Member | | Join Date: Oct 2009
Posts: 120
| | | re: Can I get some HTML code for this attached Image
I can give same name for all (instead pulg1, plug2.....I can give plug", but value has to be different, ON5 means, GPIO 5 to be high, OF5 means, GPIO 5 to low,
# <td class="on_text" align="left"><input type="radio" name="plug5" value="ON5">ON</td>
# <td class="off_text" align="left"><input type="radio" name="plug5" value="OF5">OFF</td>
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 3,664
| | | re: Can I get some HTML code for this attached Image
if I understand you right, you want only one of the GPIOs set to high. so you just need the name of that GPIO which is to be set, all others are reset to low. thus the radio for OFF is just eye candy…
| | Member | | Join Date: Oct 2009
Posts: 120
| | | re: Can I get some HTML code for this attached Image
I have 8 GPIO pins, one for each, I need to let Microcontroller know pin number and ON or OFF.
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 3,664
| | | re: Can I get some HTML code for this attached Image
so it doesn’t matter whether one or more pins are on?
| | Member | | Join Date: Oct 2009
Posts: 120
| | | re: Can I get some HTML code for this attached Image
These are independent pins, one might be high and other might be low, user can turn on any one and turn off any one. web should take one at a time.
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 3,664
| | | re: Can I get some HTML code for this attached Image
then pair the radios.
________________
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,533 network members.
|