Put A Border Around An Input Box?
Dec 26, 2011
how do i put a red border around an input box with a class of .input1 if it goes into this loop??
if(firstName=='' || firstName.length < 3 || firstName=='First Name:' ){
error = 'Please enter your first name';
$j('#errormsg').html('<p class="errors">'+ error +'</p>');
return false;
}
View 3 Replies
ADVERTISEMENT
Jan 15, 2011
Currently on my form if you your input dosn't pass my validation you will see an error message and red box will also appear around the input box. The issue is that if you will it out the box will not disappear until you hit submit. Obviously that is because I have PHP validate the form, but I would like for the red border to go away as soon as the conditions are met, which is why I thought, JS would be the best solution.
I know how to write a conditional state in JS but I am not sure ho to echo out different classes based on the conditions.
View 3 Replies
View Related
Feb 26, 2009
What I want to do is change the border of several images on the page to show a 4px border. There are many images on the page so I just want to call the changeborder() function on the onClick event so as the image that has been clicked changes. However, I don't think using this.style.border to identify the element works when placed within the function. That is, how do I identify, from the function, which image has been clicked? My current code (which does not work) looks like this but I am sure its possible to gather what i'm trying to achieve:
<script type="text/javascript">
function changeborder()
{
this.style.border='4px solid red'
}
</script>
<img style="border: 1px solid #F4F4F4;" onclick="changeborder()" src="images/colours/010.jpg" border="0">
View 1 Replies
View Related
Jan 7, 2009
is there a way how to detect if mouse is over the border table and over cell border? and if yes, when user click and host button and move mouse cursor (to increase cell width) which event should i detect ?
View 1 Replies
View Related
Jul 23, 2005
When I use this code....
window.open('gallery/pic1.jpg','windowname','width=775,height=550,resiz able=yes,scrollbars=yes,top=10,left=10');
....my web page displays a picture with a white border around it. Is there a
way to get rid of the white border? I want to continue to link directly to
my image (pic1.jpg) and not to an HTML page. The reason for this is because
if I link directly to an HTML page then I seem to have problems with pop-up
blockers.
View 1 Replies
View Related
Sep 4, 2006
Wondered if you could let me know if I've missed something when setting up a
table.
If I use the following:
<TABLE WIDTH=500 BORDER=1>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
</TABLE>
All 4 sides of all of 4 table cells have a border 1 pixel in depth -
perfect!
If I change this to:
<TABLE WIDTH=500 STYLE="border: 1px dashed black">
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
</TABLE>
I only get a border on the outer 'wall' of the table - no borders on the
cells!!!
Due to the project I'm working on, I'm dynamically creating rows and cols in
DOM, I'd really like to just specify that all of the cols/rows have a border
in one go like the old table method rather than having to define the border
style for each cell.
I can't use the old table method of BORDER=1 because I need the dashed style
rather than a solid border. Any ideas on how I can do this?
View 3 Replies
View Related
Dec 8, 2006
I have the following problem:
An input field get a border assigned by a style class (e.g. 2px solid red).
When the field gets the focus, we set the border to green.
element.style.border = "2px solid green";
When the field looses the focus, the border should change back to red.
We just want to remove the style we have set, when the field has got the
focus, so that the style class is visible again.
element.style.border = "";
Under Firefox that works but not under IE.
We have changed to the class mode, because we don't want to save the
previous setting and restore it later.
Is there a possibility to remove the style (especially the border style)
under IE, so that the style of the assigned class is visible again?
element.style.removeAttribute doesn't seem to work, but may be I make
something wrong? Code:
View 1 Replies
View Related
Mar 11, 2007
Can someone point me to some resources on how to tile an image to create a
border?
<td><img src="images/MTile.png" width="1" height="30" alt=""></td>
I have something like that where I need to repeat x times where x depends on
the width of the browser. (Not sure if its a good idea to use a bitmap of
width 1 but I could use one that is larger and then use both(e.g., maybe one
that is 10 pixels wide and repeat that as needed and let the 1 pixel wide
one get the rest(I have some "ends" on the border that I need to display too
so it sorta needs to be exact))
Not sure how to do this with js(just learning it) but obviously I just need
to get the width of the border and then figure out how many times I need to
repeat the code.
I have several issues I am wondering about though. First off is that I have
used photoshop imageready to create a roll over menu bar but in firefox when
I use the down state it leaves a selection rectangle around the image but in
IE it does not do this. It does not look nice in firefox and I'm sure there
is some way to prevent it. (for some reason it selects it when you click the
menu item and this probably can be turned off using css?)
Another issue, which isn't a big deal, is that I'm using symmetric bitmaps
to "cap" the border. I was wondering if it is possible to flip the image
using html or js so that I don't have to have a seperate image for it?
View 7 Replies
View Related
Oct 12, 2011
've been grinding this for days and nothing seems to work. I'm using a JQuery script (or a variant) called the bx.Slider [URL].. It works well. It's all positioned properly. I use my own prev/next images, and there is the ugly blue border around them in IE 8 only. I've tried removing the border, both in the js file (jquery.bxSlider.min.js), in my own syle sheets where you can style the js created classes, or inline, in the tags themselves... None have worked in any way, shape or form.
Maybe I am looking in the wrong places, but I can't seem to find the answer. Does anyone know of a trick or two regarding this?
View 3 Replies
View Related
Jun 2, 2011
I am using DOM table insertrow as such:
Code:
var _table = document.getElementById("TableList").insertRow(0);
_table.border = 1;
var cell0 = _table.insertCell(0);
var cell1 = _table.insertCell(1);
[Code]....
but it does not seem to work. how to get a border on the individual row?
View 1 Replies
View Related
Apr 3, 2011
Below is the routine I am using that when invoked swaps images for other images:
<script>
function swapImage(swapContName) {
if (swapContName == 'mainImage1') {
[code]....
But one of the images I would like to vanish (using the empty spacer.gif) has a border:
<img id="instructflag" border="1" src="FLAG.gif" width="23" height="15" align="left">
It must have this black border, but when it gets swapped for a blank, I am left with the black square. how to vanish the border along with the graphic?(I have some vague idea that "border" is not used any more, but anyway...).
View 3 Replies
View Related
Jan 19, 2006
I am using Dreamweaver to open a pop up window when you click in a thundnail to make the picture bigger. In Dreamweaver you have the option to specify the dimensions of the pop up window(in my case the same as the photograph). It seems to work fine in Explorer, but Safari leaves a white border along the right and bottom edges(aprox 14 pix). I have tried to do the window smaller but then in other browsers you need scroll bars. I would like the new window be exactly the same size of the photograph. Is there any easy way to control this?
View 3 Replies
View Related
Aug 26, 2009
I need to set the border width of a link when it is clicked. The link calls a javascript and so I need a way to identify which link has been clicked, hence the outline...i tried this.style.borderWidth = 'thin';but to no avail...?!I have already assigned border-color and border-style in the style sheet if that makes any difference...
View 1 Replies
View Related
Nov 4, 2009
I have a link, which triggers a script, but when the link is clicked, i want it to get a border around it... currently tried onclick="this.style.borderWidth = 1px"
View 4 Replies
View Related
Feb 4, 2010
i need make effect on div see image.
On the image we have two border top and under and borer have effect. i wish make this effect width javascript.
how get this effect ?
View 3 Replies
View Related
Jul 20, 2010
I'm developing a search feature to the following website: REMOVED THE LINK As you can see, the table has a mouseover effect that paints the current hovered row's border. Because I couldn't find any way of drawing a border around the tr only, I had to set all <td> borders white and after that set the top and bottom borders of all <td>'s pink. The first td is set to left border pink and the last one of the row receives right border pink. This is done in jquery's mouseover event. The problem is the border is no continuous, as you can see in the attached image. And that's pissing off my client. Do you have a solution? I've used padding: 0; border collapse.. I don't know what else to do.
View 3 Replies
View Related
Feb 6, 2006
I am working on creating a simple image gallery. I have added styling around the thumbnail images (border and padding). I would like to change the border color when the item is hovered over. I know this can be done rather easily with the getElementById command. Can someone help me understand this process? Here's a snippet of the list that I am working with...
Here's the CSS:
ul {
padding:0;
margin:0;
position:relative;
}
li {
float:left;
padding:0 .5em .3em .5em;
list-style:none;
}
#gallery {
list-style:none;
}
#gallery li {
display:inline;
}
#gallery li a img {
border:1px solid #ccc;
padding:3px;
}
Here's the HTML:
<ul id="gallery">
<li><a href="path/to/image/large/" title="title/of/image/"><img src="path/to/image/thumb/" alt="title/of/image/" /></a></li>
<li><a href="path/to/image/large/" title="title/of/image/"><img src="path/to/image/thumb/" alt="title/of/image/" /></a></li>
<li><a href="path/to/image/large/" title="title/of/image/"><img src="path/to/image/thumb/" alt="title/of/image/" /></a></li>
</ul>
I would like to change the border color from #ccc to #3455ef when the item is hovered over, and ideally have a different style when the item is clicked (or active).
View 3 Replies
View Related
Aug 14, 2010
...I have an element (for example <div>) that i displayed in my browser is overflowed and overflow is hidden.Now after displaying browser when I move my mouse over to it, I want to add a border to the <div> using jQuery Code:.css("border","2px solid red"). But the problem is::: at left side and top side border is added but at bottom and right border not added since these 2 sides overflowed.
View 2 Replies
View Related
Jan 10, 2011
I've been searching for a way to get border-radius working in Internet Explorer by using JavaScript or a JavaScript library like jQuery. With so many browsers now supporting border-radius, it just seems silly to me that we use all this extra markup just for rounded corners in IE.
View 7 Replies
View Related
May 24, 2007
I made a popup window with createpopup(). The window has a frame
border around it that is grey. I can't seem to find the code that
would not allow the frame of the popup to show.
I've experimented with this:
this.mypopup.document.frameborder=0;
window.frame=0;
Ultimately, I would like to know if it is possible to get rid of the
frame border on the popup window created from createpopup();
View 1 Replies
View Related
Jul 20, 2005
I would like to have just the top row cells of a table to have borders - is
this possible/easy? or do I have to make the title row another table?
View 2 Replies
View Related
Dec 23, 2010
How would that be?something like this?:
if ($(this).(BORDER-COLOR PROPERTY?) == "#990033")
{
alert("Yes, border color is #990033");
[code]....
View 2 Replies
View Related
May 1, 2009
I taught it to myself without even having any true JavaScript experience and am sure that while functional, many of my implementations could/should be written completely differently. I'm running some animations that look great in everything except for IE. In IE I'm seeing a thin, ragged black border around some of the elements that I'm animating.
View 1 Replies
View Related
Jun 28, 2009
I have a couple of images in a fisheye that I want to be displayed with some space between them. Currently, jQuery displays the images directly connected to each other:
[Code]...
View 5 Replies
View Related
Mar 9, 2010
I imagine this is trivial - in fact it must have been asked before, I just can't find the answer. I have looked.I have a dotted bottom border defined on my link hovers, like so [code]
View 5 Replies
View Related
Mar 15, 2011
I have CSS defined as:
#container {
width:400px;
border:1px solid red;
}
I was not able to get the value using $("#container").css("border"), but $("#container").css("width") is ok,
View 1 Replies
View Related