I want to display Hightlight on element that contains tabindex.
<FORM ACTION="../cgi-bin/mycgi.pl" METHOD=POST>
<TABLE BORDER CELLPADDING=3 CELLSPACING=5 BGCOLOR="#FFFFCC">
<TR>
<TD>name: <INPUT NAME="realname" TABINDEX=4 ACCESSKEY="g" VALUE="Go!"></TD>
<TD ROWSPAN=3>comments<BR>
<TEXTAREA COLS=25 ROWS=5 TABINDEX=3></TEXTAREA></TD></TR>
<TR> <TD>email: <INPUT NAME="email" TABINDEX=2></TD></TR>
<TR> <TD>department: <SELECT NAME="dep" TABINDEX=1>
<OPTION VALUE="">...
<OPTION VALUE="mkt">Marketing
<OPTION VALUE="fin">Finance
<OPTION VALUE="dev">Development
<OPTION VALUE="prd">Production</SELECT></TD></TR>
<tr>
<td><input type="button" tabindex="7" value="Tab7"></td>
<td><a href="http://www.google.com" tabindex=6>This is tab6</a></td>
</tr>
<tr>
<td><p tabindex=8>this is tab 8</p></td>
<td><span tabindex=9 onkeypress="return runScript(event)">this is tab 9</span></td>
</tr>
<tr>
<td><input tabindex=10 id="scriptBox" type="text" /></td>
</tr>
</TABLE>
</FORM>
When I press Tab key 4 times it goes to element that contains "tabindex=4" and display highlight on it.
I am happy to get idea from you.
Cheer,
Chanthou
You can select all elements with a tabindex attribute:
<style>
*[tabindex] {
border: solid red 1px;
}
</style>
<p><input type="text" tabindex="1" /></p>
<p tabindex="2">Hello</p>
The question is a little ambiguous - did you want to highlight an element when it has focus or highlight an element that can have focus?
If you know css, you can use the :focus pseudo-class to highlight an element when it has keyboard focus.
The following style will make all inputs' background color change to grey when they receive keyboard focus:
input:focus { background: #ccc; }
Related
I’m just putting together a HTML table for a wix site and for some reason the table is coming out looking all kinds of funky. There seems to be excessive spacing on the left hand side and the submit button will not position to the right edge of the input boxes? Also, I am trying to change the background colour of the input boxes to '#3A3B3F' but for some reason everything I try is not working, not sure if I have made a fundamental error in the code somewhere. If anyone can provide me with any assistance to this I would be eternally grateful! this is a copy of the tables code and a screengrab of how the table currently looks: Screenshot of table
<style>
#crmWebToEntityForm tr , #crmWebToEntityForm td {
padding:6px;
border-spacing:0px;
border-width:0px;
}
</style>
<table style='width:600px;background-color:#3A3B3F;background-color:#3A3B3F;color:#3A3B3F'><tr>
<td colspan='2' align='left' style='color:#ffffff;font-family:Avenir;font:Avenir;font-size:18px;word-break: break-word;'><strong></strong></td>
</tr> <br></br>
<tr><td style='word-break: break-word;text-align:left;font-size:16px;font-
family:Avenir;font:Avenir;width:30%;'><span style='color:red;'></span></td>
<td style='width:40;' style='height:40px'' ><input type='text' placeholder="First Name"
style='width:200%; height:50' box-sizing:border-box;' maxlength='0' name='First Name' />
</td>
<td style='width:350px; style='height="50px" ></td></tr>
<tr><td style='word-break: break-word;text-align:;font-size:16px;font-
family:Avenir;font:Avenir;width:350px'><span style='color:red;'></span></td>
<td style='width:40%;' ><input type='text' placeholder="Last Name" style='width:200%;
height:50' 'box-sizing:border-box' maxlength='80' name='Last Name' /></td>
<td style='width:350px; style='height="50px"></td></tr><tr><td style='word-break: break-
word;text-align:left;font-size:16px;font-family:Avenir;font:Avenir;width:30%;'><span
style='color:red;'></span></td>
<td style='width:40%;' ><input type='text' placeholder="Email Address"
style='width:200%;height:50''box-sizing:border-box;' maxlength='100' name='Email' /></td>
<td style='width:350px; style='height="50px"></td></tr><tr><td style='word-break: break-
word;text-align:left;font-size:16px;font-family:Avenir;font:Avenir;width:30%;'><span
style='color:red;'></span></td>
<td style='width:40%;' ><input type='text' placeholder="Phone Number" style='width:200%;
height:50''box-sizing:border-box;' maxlength='40' name='Phone' /></td>
<td style='width:350px; style='height="50px"></td></tr><tr style='display:none;' ><td
style='word-break: break-word;text-align:left;font-size:16px;font-
family:Avenir;font:Avenir;width:30%'>Lead Source</td><td style='width:40%;'>
<select style='width:100%;box-sizing:border-box;' name='Lead Source'>
</select></td><td style='width:30%;' ></td></tr><tr style='display:none;' ><td
style='word-break: break-word;text-align:left;font-size:16px;font-family:Arial;width:30%'> Introducer </td>
<td style='width:40%;' ><input type='text' style='width:100%;box-sizing:border-box;' maxlength='255' name='LEADCF1' value='ContractorPeople'></input></td>
<td style='width:30%;'></td></tr><tr><td style='word-break: break-word;text-align:left;font-size:16px;font-family:Arial;width:30%;' ></td><td style='width:40%;'> <textarea name='Description' maxlength='32000' style='width:200%;height:100' > </textarea></td>
<td style='width:30%;'></td></tr>
<tr><td colspan='2' style='text-align:69%; padding-top:15px;font-size:16px;'>
<button id="formssubmit">SUBMIT QUERY</button><style type="text/css" type="submit">
#formssubmit {
background-color: #ffffff;
padding: .5em;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 6px;
color: #ddddd;
font-family: 'Avenir';
font-size: 20px;
text-decoration: none;
border:color:#ffffff;
}
#formssubmit:hover {
border: none;
background: #9799A4;
box-shadow: 0px 0px 1px #ffffff;
}
I had a look and there is a lot going on.
I don't see why in each row you have 3 columns. I would remove the first and last as you use your input in the 2nd td but the first and last seem empty:
I would move these table divisions and work with what is left:
<td style="word-break: break-
word;text-align:left;font-size:16px;font-family:Avenir;font:Avenir;width:30%;"><span style="color:red;"></span></td>
<td style="width:350px; style=" height="50px"></td>
then you can style the td with your input, you can for example use padding: 0 20px or style different width so you can position all your inputs the way you want to.
regarding background colors of the input boxes and since you are using inline style you can simply do:
<input style="width:200%;height:50; background:#3A3B3F;">
regarding the button positioning:
now that you have less table divisions it's also easier to position your button on the right. You can for example add the following css to your formssubmit button:
#formssubmit {
float: right;
margin-right: 10px;
margin-bottom: 10px;
}
and it will position on the right with a bit of margin.
Does that already help reshape your form a bit closer to what you want it to be?
I am working on a project. You can access to the page here
Here is the small bit where the error happens
<div class="col-sm-6 responsive-table">
<table>
<caption>Page template</caption>
<tr >
<td class='leftCol'>Easy</td>
<td ><input ng-model='page.easy' ng-model='wordpress' min=0 type='number' class='form-control numberInput' ></td>
</tr>
<tr >
<td >Medium</td>
<td ><input ng-model='page.medium' type='number' min=0 class='form-control numberInput'></td>
</tr>
<tr >
<td class='leftCol'>Hard</td>
<td ><input ng-model='page.hard' type='number' min=0 class='form-control numberInput'></td>
</tr>
</table>
</div>
<div class="col-sm-6 responsive-table">
<table>
<caption>Frontpage template</caption>
<tr >
<td class='leftCol'>Easy</td>
<td><input ng-model='frontpage.easy' type='number' min=0 class='form-control numberInput'></td>
</tr>
<tr >
<td >Medium</td>
<td><input ng-model='frontpage.medium' type='number' min=0 class='form-control numberInput'></td>
</tr>
<tr >
<td class='leftCol'>Hard</td>
<td><input ng-model='frontpage.hard' type='number' min=0 class='form-control numberInput'></td>
</tr>
</table>
</div>
</div>
When I clicked the input text boxes in the app, the whole group moves. Anyone knows why?
At first I thought it would be because of data-toggle tooltip. I tried to fix with adding container body to the element but it just does not work. I think it is not because of the tooltip because I even removed the tooltip stuffs but it still does not work.
Thank you for reading! Any answers, tips or suggestions is welcome.
I tried it in chrome and saw no offsets when clicking in. This might be due to css issuses. Note that angular modifies the input's class when you click in it, outside, change value etc. Some of the classes that are modified are:
ng-pristine, ng-dirty, ng-valid, ng-invalid, ng-touched (there are probably more).
If your css has a definition that changes the element size, for example a different border for an active object, it might generate such effect.
One way to track the issue would be to use chrome and do the following:
1. Right click the field and select 'inspect elemenet'
2. The DevTools window opens, now click in and out of the input element and see what classes are changed, the DevTools animate the changes for you and you will have a visual cue.
3. See what definitions might be affecting the layout.
I have a jsfiddle below:
http://jsfiddle.net/C95uc/3/
I am having trouble with my css. I want to display both drop down menus on the left above one another and I want to display the text inputs on the right hand side, but how can I do this?
Below is the html code:
<div class='lt-container'>
<form id='moduleForm'>
<select name="module" id="modulesDrop">
<option value="">Please Select Module</option>
</select>
</form>
</div>
<div class='lt-container' >
<form id='moduleExistForm'>
<select name="module" id="modulesDrop">
<option value="">Please Select Course</option>
</select> </form>
</div>
<div id='rt-container' >
<form id='detailsForm'>
<table>
<tr>
<th></th>
<td><input type='hidden' id='idmodule' name='moduleid' value='' /> </td>
</tr>
<tr>
<th>Module ID:</th>
<td><input type='text' id='nomodule' name='moduleno' readonly='readonly' value='' /> </td>
</tr>
<tr>
<th>Module Name:</th>
<td><input type='text' id='namemodule' name='modulename' readonly='readonly' value='' /> </td>
</tr>
<tr>
<th>Credits:</th>
<td><input type='text' id='credits' name='creditsname' readonly='readonly' value=''/> </td>
</tr>
</table>
<div id='moduleAlert'></div>
</form>
</div>
CSS:
.lt-container, #rt-container {
float: left;
}
#rt-container {
clear: right;
margin-left: 5%;
}
http://jsfiddle.net/C95uc/4/
<div class='lt-container'>
<form id='moduleForm'>
<select name="module" id="modulesDrop">
<option value="">Please Select Module</option>
</select>
</form>
<form id='moduleExistForm'>
<select name="module" id="modulesDrop">
<option value="">Please Select Course</option>
</select> </form>
</div>
Both <select> go in the same <div class='lt-container'>
The two dropdowns don't stack on top of each other because you have assigned both of them a "float:left" property which makes them go side by side. Instead, wrap them in a div and make that div float left.
<div class="lfloat">
<!-- Both Dropdowns -->
</div>
CSS:
.lfloat {
float:left;
}
Be sure to add a "float:right" property to the form so that it doesn't appear below the two drop downs.
Example: http://jsfiddle.net/C95uc/5/
So I am web developer who used to have a kind graphics design person help me out on this sort of browser compatibility hell, but alas he has moved on to greener pastures. The following html looks fine and dandy on chrome, but the table I am using to align my form is sleeping on the job on the bottom in ie and firefox. Should I never use tables? Is the float in the div tags screwing everything up? Any hints or suggestions for improving my html and css would be much appreciated.
Also, the text area text gets a little screwy sometimes in terms of where it is positioned in the box.
Thank you all.
<div style="border-style:solid; border-color:#336699; padding: 5px; margin-left:auto; margin-right:auto; width:600px; height:300px;" id="demoContainer">
<div style="" id="demo">
<div style="" id="demoHeader">
<img src="someimage" />
<span style="font-size:32px;">Demo</span>
</div>
<div style="" id="demoBody">
<form method="get">
<div style="float:left; padding:5px;" id="demoBodyText">
<textarea style="resize:none;" rows="10" cols="30">
Enter demo text here...
</textarea>
</div>
<div style="float:right; padding:5px;" id="demoBodyOptions">
<table style="float:right;">
<tr>
<th>
Option 1:
</th>
<td>
<select style="">
<option>asdf</option>
</select>
</td>
</tr>
<tr>
<th>
Option 2:
</th>
<td>
<select style="align:left;">
<option value="320">Fastest</option>
<option value="260">Faster</option>
<option value="200">Fast</option>
<option value="170" selected="selected">Default</option>
<option value="130">Slow</option>
<option value="110">Slower</option>
<option value="80">Slowest</option>
</select>
</td>
</tr>
<tr>
<th>
Option 3:
</th>
<td>
<select>
<option value="4.2">Highest</option>
<option value="3">Higher</option>
<option value="2">High</option>
<option value="1" selected>Default</option>
<option value="0.8">Low</option>
<option value="0.6">Lower</option>
<option value="0.4">Lowest</option>
</select style="align:left;">
</td>
</tr>
<tr>
<th>
Option 4
</th>
<td>
<select>
<option value="none">None</option>
</select style="align:left;" >
</td>
</tr>
<tr>
<td>
<input type="submit" />
</td>
</tr>
</table>
</div>
</form>
</div>
<div style="clear:both;" id="demoFooter">
Footer
</div>
</div>
</div>
EDIT: Added image in how it displays in my firefox version 10.
If you have a float:right after a float:left this seems pretty normal.
Try to switch the order of the two or give the second one also float:left
Or maybe the padding is the problem?
http://jsfiddle.net/HerrSerker/55cXT/
What are the width of your floated divs #demoBodyText and #demoBodyOptions?
See the fiddle - Is this you are looking for?
Fiddle: http://jsfiddle.net/jKtkq/
Demo: http://jsfiddle.net/jKtkq/embedded/result/
Screen shot: http://img39.imageshack.us/img39/7676/tableissue.jpg
I am making 2 different web application for smart phones, using jQuery mobile and webapp-net.
so far I have the following codes: (its just a part of these codes, since I can not put the whole thing here)
<div data-role="collapsible" data-collapsed="true">
<h3>Eenmalige machtiging </h3>
<div data-role="fieldcontain" >
<form >
<input type="number" pattern="[0-9]*" id="anum" maxlength="9" placeholder="Account Number" autocomplete="off" onBlur="isValidAnum()" onFocus="emptyAnum('anum')"/>
<input type="text" id="bname" placeholder="Beneficiary Name" autocomplete="off" onBlur="isValidBname()" onFocus="emptyBname('bname')"/>
<table>
<tr><td>
Select Your Bank
</td>
<td>
<select name="select-bank" id="select-bank" class="select-bank" data-inline = "true" >
<option value="abn">ABN Amro</option>
<option value="rabo">Rabo Bank</option>
<option value="ing">ING Bank</option>
<option value="overige"> --Overig--</option>
</select>
</td>
</tr>
</table>
<table>
<tr>
<td>I Agree </td>
<td><input type="checkbox" class = "checkbox" name="cbox" id="cbox2"/></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<br/>
<a data-role = "button" type="submit" data-icon = "check" data-theme="b">Pay</a>
</form>
</div>
</div>
</div>
</div>
and:
<button class="form_header" id="last_method"><img src="appimages/directdebit_NL.png" align="middle" /> Eenmalige Machtiging</button>
<div class="form_body">
<fieldset>
<ul>
<li>
<input type="number" pattern="[0-9]*" id="anum" maxlength="9" placeholder="Account Number" autocomplete="off" onBlur="isValidAnum()" onFocus="emptyAnum('anum')"/>
</li>
<li>
<input type="text" id="bname" placeholder="Beneficiary Name" autocomplete="off" onBlur="isValidBname()" onFocus="emptyBname('bname')"/>
</li>
<li>
<table>
<tr><td>
Select Your Bank
</td>
<td>
<select name="select-bank" id="select-bank" class="select-bank" data-inline = "true" >
<option value="abn">ABN Amro</option>
<option value="rabo">Rabo Bank</option>
<option value="ing">ING Bank</option>
<option value="overige"> --Overig--</option>
</select>
</td>
</tr>
</table>
</li>
<li>
<table>
<tr>
<td>I Agree </td>
<td><input type="checkbox" class = "checkbox" name="cbox" id="cbox2" /></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<input type="submit" value="Pay" class="pay_button"/>
</li>
</ul>
</fieldset>
</div>
</div>
</div>
Now I have to create a .vm file using these two codes, in order to do that I need to see what are the difference in html between these two. I tried to make it look alike each other as much as I could, I dont think I can change them any more. I was also trying to work with their css but I didnt change anything.
my question is there a possible way to put these html in a single .vm file??? if you know how to do it please help me, also if you need more info just ask me.
Are you talking about file diff? Where you check the differences in two files and merge them?
There is winmerge http://winmerge.org/
There is examdiff. Do a google search for file comparison or file diff