|
Thanks, I found it.
modified on Monday, October 27, 2008 5:23 PM
|
|
|
|
|
Hi,
I have an image, and I am trying to add a border around my image. The distance from the image to the border must be 5 pixels. My code is not working, not sure why.
Here is my HTML:
<img src="Images/sub_category_1.jpg" class="grey" />
Here is my style:
img .grey
{
padding: 5px; margin: 5px;
border: solid 1px #000;
}
What am I doing wrong?
Thanks
Brendan
|
|
|
|
|
I guess you should use
.grey
{
padding: 5px; margin: 5px;
border: solid 1px #000;
}
<img src="Images/sub_category_1.jpg" class="grey" />
|
|
|
|
|
This[^] should help.
Cheers,
Drew.
|
|
|
|
|
Hi,
I am working on a custom rich-text editor using contentEditable. When the return key is pressed I am preventing the default action, and inserting a line break tag to ensure that the browser doesn't create a paragraph element.
In IE I have this working great, but in Chrome, Safari, and FF the selection doesn't appear to update correctly. The break tag is inserted, but the input caret does not move. For test purposes I have replaced the break with a horizontal rule. Upon pressing enter, the caret should move after the HR element, but it doesn't.
<html>
<head>
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript">
window.onload = function(event) {
document.observe('keydown', doc_keydown.bindAsEventListener(document));
}
function charCode(event) {
return typeof event.which !== 'undefined' ? event.which : event.keyCode;
}
function doc_keydown(event) {
var range;
var code = charCode(event);
switch (code) {
case 13: // return
if (document.selection) { // IE
range = document.selection.createRange();
range.pasteHTML("<hr />");
range.moveEnd("character", 1);
range.moveStart("character", 1);
range.collapse(false);
}
else { // FF, Google Chrome
range = window.getSelection().getRangeAt(0);
range.deleteContents();
var newNode = new Element("hr");
range.insertNode(newNode);
range.setStartAfter(newNode); // Doesn't work from here down.
range.setEndAfter(newNode);
range.collapse(false);
}
break;
default:
return true;
}
event.stop();
return false;
}</script>
</head>
<body>
<div contentEditable="true" style="border: solid 2px black; padding: 6px">
Some initial text - Edit Me!
</div>
</body>
</html>
Many thanks,
Lea Hayes
<div class="ForumMod">modified on Friday, October 24, 2008 6:39 AM</div>
|
|
|
|
|
Hello
I have worked on the same error earlier, but unfortunatly there is no way you can disable the keypress event in Firefox, Safari, etc. You can capture KeyPress events but they can only be controlled in IE.
I am sorry, i cannot help you on this topic.
|
|
|
|
|
I want to validate my conent with client side javascirpt regular expressions. words should not occur more than one time. ex ("one two one") here one comes more than one times, how to validate this using client side javascirpt regular expressions?
and another, "one" should not come after the term "only".ex "only one",
how to validate this using client side javascirpt regular expressions?
Known is a drop , Unknown is an Ocean
|
|
|
|
|
|
That is a good site. Don't forget about the Expresso tool found on this site.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Please give me the details about delegates and specify how to use in C# Console programs.
|
|
|
|
|
Please refer to
http://www.codeproject.com/KB/cs/Delegates_in_C_.aspx
In MSDN Refer
http://msdn.microsoft.com/en-us/library/ms173171(VS.80).aspx
|
|
|
|
|
Hey everyone,
recently I am workign on a project where people are able to search wines and later get them from my database. I store the variables from the search form in Session which i later retrieve in the next page (I couldnt use the query string here since its too small). However i get a problem in retrieving my data.
First of all my search field put the data to a session, here is the code.
public partial class catalogus : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void BTNzoeken_Click(object sender, EventArgs e)
{
Session["searchkleur"] = DDLkleur.SelectedValue;
Session["searchland"] = DDLland.SelectedValue;
Session["searchdruifsoort"] = TXTdruifsoort.Text;
Session["searchregio"] = DDLregio.SelectedValue;
Session["searchjaar"] = TXTjaar.Text;
Session["searchinhoud"] = DDLinhoud.SelectedValue;
Session["searchprijs"] = DDLprijs.SelectedValue;
Session["searchoverig"] = TXToverig.Text;
Session["searchwijnnaam"] = TXTwijnnaam.Text;
Session["searchproducent"] = TXTproducent.Text;
Response.Redirect("resultaten.aspx");
}
}
After this i will arrive at the resultaten.aspx page which holds the following code
public partial class resultaten : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["searchkleur"] != null)
{
string VARkleur = Session["searchkleur"].ToString();
string VARland = Session["searchland"].ToString();
System.Convert.ToInt32(VARland);
string VARdruifsoort = Session["searchdruifsoort"].ToString();
string VARregio = Session["searchregio"].ToString();
string VARjaar = Session["searchjaar"].ToString();
string VARinhoud = Session["searchinhoud"].ToString();
string VARprijs = Session["searchprijs"].ToString();
string VARoverig = Session["searchoverig"].ToString();
string VARwijnnaam = Session["searchwijnnaam"].ToString();
string VARproducent = Session["searchproducent"].ToString();
LBLtest.Text = "Kleur " + VARkleur + "<br />Land " + VARland + "<br />Druifsoort " + VARdruifsoort + "<br />Regio " + VARregio + "<br />Jaar " + VARjaar + "<br />Inhoud " + VARinhoud + "<br />Prijs " + VARprijs + "<br />Overig " + VARoverig + "<br />Wijnnaam " + VARwijnnaam + "<br />Producent " + VARproducent;
}
}
}
and here's my aspx part with the SQL command:
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ConnectionStrings:WijnhuisMDFConnectionString %>"
SelectCommand="SELECT [text] FROM [texten] WHERE textID = 26">
</asp:SqlDataSource>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" BorderStyle="None"
DataSourceID="SqlDataSource2" GridLines="None" Width="240px">
<Columns>
<asp:BoundField DataField="text" HtmlEncode="False" SortExpression="text" />
</Columns>
</asp:GridView>
now i ve got 2 error messages: First one says that my landId cannot be converted to an integer so the session variable i stored as a string can't be converted to an int although i ve told C# to convert it.
2: i get an FormatException was unhandled y user code.
Does anyone know's whats wrong or how to solve it? I can share the project files if needed. Thanks in advance for your help
|
|
|
|
|
Ok, here is your problem I think.
string VARland = Session["searchland"].ToString();
System.Convert.ToInt32(VARland);
This means your VARland value is still stored in a string variable
try this
try
{
int32 VARland = System.Convert.ToInt32(Session["searchland"].ToString());
}
catch (Exception e)
{
....do something with your exception
}
I think your second error is because you have no try catch blocks and something is generating an exception
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I am using safari 3.1.2 browser. I have problem with getting selected range object in safari.
for IE i used the function
document.selection.createRange();
it is working fine.
for sarafi i used the function
window.getSelection().getRangeAt(0)
but it always return the selected text not the range object.
I am in serious problem. Please help me.
Thanks in advance.
|
|
|
|
|
What is the difference between static internal int a=10
and
session["a"]=10
|
|
|
|
|
In which language ? PHP !
|
|
|
|
|
|
...
Blog link to be reinstated at a later date.
|
|
|
|
|
|
|
...
Blog link to be reinstated at a later date.
|
|
|
|
|
Another one of those kind who like to cross post crap, not say thanks when given a good answer, down votes folks who call them on the spot for their actions
Just mark them as Abuse, if you haven't already.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi everyone!
I am experimenting with a rich text editor by using the contentEditable feature of HTML. I have the basic editor working, but I have run into a serious issue in FireFox. When you hit the return key, a second element of the same type is created...which is good. BUT If the element which was being typed in had an ID attribute, that ID gets duplicated into the new element. In fact, all attributes get duplicated into the new element.
Does anybody know how I can disable this default behavior? Or at least with regards to custom attributes?
If only there were some way to manually determine how elements are created...
Many thanks,
Lea Hayes
|
|
|
|
|
Hi
Developing a online web application ,In this i develop a registration module for consultant.the consultant are able to see this page
The site has to check what consultant is seeing the page
IT displays the consultant seeing (information)the page
(Using active directory information )
Please suggest me what is Active Directory Information & How to do it?
|
|
|
|
|
I have a working C# program. It's a gui that lets me access my parallel port. I would like to be able to convert it into a web page now. I've tried the copy past and start debugging approach. I think it's over my head.
I would like to know where to go or who to contact to have a pro work on it. I am willing to pay a programmer for a few hours of thier time. I will provide my working program and I can pay with paypal. Can someone please advise.
|
|
|
|