|
Ok, i've already started.......... may take some time, trying to get the structure and appropriate content is a challenge!
|
|
|
|
|
|
Ok, this is the right reply
I've written some C# code to access this data using a WebBrowser object.
Are you interested in?
|
|
|
|
|
Good Day All
in my page i have a hyperlink button in a gridview defined like this
<a href="#" onclick="<%# String.Format("return showComment('{0}','{1}')", Replace(Eval("Field1").ToString(),Chr(13),"<BR>"), Replace(Eval("Field2").ToString(),Chr(13),"<BR>") ) %>">
<img src="../../Imgs/comment2.png" />
</a>
and the Function showComment is defined like this
function showComment(CommentPend,CommentCancel)
{
$("#btnclose").unbind();
$("#divPendComment").center();
$("#divPendComment").fadeIn('slow');
$("#txtcomment").val(CommentPend.toString().replace(/^[a-z0-9 ]$/i, ''));
$("#txtcommentCancel").val(CommentCancel.toString().replace(/^[a-z0-9 ]$/i, ''));
$("#btnclose").click(function (e)
{
$("#divPendComment").fadeOut('slow');
e.preventDefault();
});
return false;
}
now as you can see i am trying to get rid of the special characters like the carriage returns but still i get a a javascript error when this link is clicked
Uncaught SyntaxError: Unexpected token ILLEGAL
thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
It means you've committed a crime. Be prepared for arrest.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
lol indeed a string with special characters is a crime , especially the carriage return
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
I am not 100% sure what you are trying to achieve, but replace(/^[a-z0-9 ]$/i, '') is probably not what you intended: It says "If the whole field consists of a single letter, digit or space then set it to an empty string; if it is not just a single letter, digit or space, keep the whole lot as seen". My guess is that you want all non-letter/digit/space chars to be blanked out. Try replace(/[^a-z0-9 ]/ig, '') .
modified 28-Oct-11 8:03am.
|
|
|
|
|
Good Day All
i have a Jquery code defined like this
$(".cnt").focus(function()
{
if(this.value == this.defaultValue){
this.select();
}
});
and i am creating a textbox on fly and after creating it i bind data to it and after that i want to attach a focus event if there a value "0" on it
If cnt.Text = "0" Then
cnt.CssClass = "cnt"
End If
but still when i select a textbox that has "0" it does not select the whole content of the textbox. i went through a breakpoint and it goes through this line
cnt.CssClass = "cnt"
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
First check if the HTML DOM element that corresponds to the textbox has its class attribute set to "cnt". You can do this with FF FireBug for instance or IE Developer Tools. Then change your javascript code like below to see if this.select() would ever be hit at all:
if(this.value == this.defaultValue){
alert("Before this.select();");
this.select();
}
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
it sounds like what you are trying to do is change the class of the control and then expect events to be fired for any control that is bound to that class.
what you are running into is a late binding issue with jQuery. when you bound the focus event jQuery only did it for the controls that had that class at the time of the binding.
three approaches:
1 - bind the focus event for that class each time you add or remove it. personally not the best approach (IMO).
2 - bind the focus event to the control type and then in the focus event test to see if the control has that CSS class associated with it.
3 - use .live[^] which is supposed to work around the late binding issue. I personally have not had a chance to use it but it was designed to handle this very thing.
best of luck
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
Thanks guys for the reply, to resolve this i applied this to all the textboxes like this
$(document).ready(function()
{
$("input:text").focus(function()
{
$(this).select();
}
);
});
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
Is it possible to change the size of entire website??
I am trying to do this to support users display resolution by changing size of my web page.
for e.g if resolution is 1280X1024, then width=100% and height =100%. This setting as it was made for this resolution.
if resolution is 1024X768, then width=90% and height=100%;
and other settings.
Is it possible to do it using javascript or any other language???
If yes then please post the code
Thank you for your help
|
|
|
|
|
Yes, you can change the dimensions of an HTML element using JavaScript. It would go something like this:
document.getElementById("someDiv").style.width = "700px";
Here is an example of how I have done it with an image: http://aspdotnetdev.com/DevPortfolio/FullscreenImage.aspx?ImageID=10
That's a little different than setting the size of a DIV, for example, because I used the width/height property on the image rather than the width/height property on the style of the image. Still, that should give you a good idea of how to resize webpage elements when the window size changes.
Now, if you are talking about changing the size of each element on a page, that would be much tricker. For that, just rely on the user to adjust their zoom level when viewing webpages.
Somebody in an online forum wrote: INTJs never really joke. They make a point. The joke is just a gift wrapper.
|
|
|
|
|
|
I tried but it did not work
I tried it in this way
<script type="text/javascript">
var ScreenWidth=screen.width;
var ScreenHeight=screen.height;
if(ScreenWidth=="1280"&&ScreenHeight=="1024")
{document.getElementById("body").style.width = "10%";
}
</script>
where I tried to apply it to the boy
and
<script type="text/javascript">
var ScreenWidth=screen.width;
var ScreenHeight=screen.height;
if(ScreenWidth=="1280"&&ScreenHeight=="1024")
{document.getElementById("outer").style.width = "10%";
}
</script>
Here body is the body and outer is the outermost wrapper div which I have
Plz help
|
|
|
|
|
really need to see the whole thing.
it could be various problems causing the problem. maybe another css dynamically updating the content or worse yet your code not running properly??
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
its extremely huge should I post everything including all the exisitng js?
|
|
|
|
|
maybe not.
what I would recommend instead then is breaking this up into its own example (but still full js and html) and working with it from there. I have found it best to isolate problems this way when the total solution has a lot of other "stuff" happening.
in debugging this my first assumption is that you javascript just isn't executing or isn't executing completely. after that I would assume that some sort of css rendering is interfering with what you are trying to do.
plus the other bonus in breaking it up into a small and complete solution is that you can post it back to a question forum when you have tried everything.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
myHeight = window.screen.height;
myWidth = window.screen.width;
If you want to find only the usable area (space that remains after taskbar etc) use "availHeight" and "availWidth"
So you can have various CSS classes for the various screen resolutions and by checking user's resolution you can change them on the fly!
CSS:
.class1024 {
color : "green";
}
.class800 {
color : "blue";
}
JavaScript:
if(myWidth == 1024) {
elem.className='class1024';
}
else if (myWidth == 800) {
elem.className='class800';
}
Hope this helps!
-Shenbaga Murugan Paramasivapandian
I hate computers and I just mess them up with my code!
|
|
|
|
|
Hi there, I like your intention that you would like to manually change website size after knowing the user's screen dimensions, but hey! that is simply a waste of time and might make u write 1000s lines of code which might actually not work on every computer.
A properly designed website will at most resize itself when rendered by a browser. Mostly all you need is to set the width of the outter content (div) to say: width:960px;
Don't set the height, let the browser decide how much your web page will grow downwards.
Honestly speaking, it's messy to rely on your clients resolution to determin your page display layout.
In my designing, i just design one site with one set dimension and that's it! the rest will sort itself on client-side without any javascript/jQuery involved.
Happy designing,
Morgs
|
|
|
|
|
Hello All, I have a thumbnail image inside of a table cell that when clicked displays an image that is much larger than the table cell. The problem I am having is that I can not make the larger image display on its own layer so that it hovers above all other page elements and does not stretch the table cell that is holding it. I have tried changing the Z-indez but it does not help. Please point me in the right direction, thanks in advance for your help.
-- modified 16-Oct-11 2:12am.
|
|
|
|
|
This is commonly called a "lightbox" or "dialog".
jQuery UI Dialog does this (note that their website seems to be having trouble right now loading CSS and images). I used Firebug to inspect it and they appear to be using the z-index approach. I recommend using Firebug (or a similar tool, such as Developer Tools in IE or Chrome) to inspect the z-index and ensure the other elements on the page do not have greater z-indexes. Also make sure you aren't making silly mistakes, such as putting the z-index in the class attribute rather than the style attribute (I just make that mistake today) or setting the property incorrectly through JavaScript. Firebug should help with that too.
If you are still having troubles, come back here and 1) show some simple sample code to replicate the issue and 2) explain what exactly you mean by "it does not help". Any additional information would be useful (e.g., the browser you are using, some screenshots).
Somebody in an online forum wrote: INTJs never really joke. They make a point. The joke is just a gift wrapper.
|
|
|
|
|
Hi and thank you so much for replying. I am trying out your suggestion of using Firebug to determine the z-index of other page elements to make sure they are not greater than the z-index of the image I am trying to display. If I'm still unsuccessful I will definitely ask for help.
|
|
|
|
|
I want to read the content of existing excel file using java script, and then download the file with those contents.
Thanks.
|
|
|
|
|
if the file is located on the server then you should be able to use AJAX and issue a GET request to retrieve the file from the server.
are you using jQuery?? I seem to recall $.ajax({...}) having an example of how to do this.
if you can offer some more details of what you are trying to do and where the file is located that would help a bit more.
|
|
|
|