|
I know that I can use javascript to test for a number using the below, but I am having trouble figuring out how to use javascript to test for the entry of for example 100.00 or 100, the decimal point is messsing me up. Any help would be appreciated.
function TestKeyPress( obj, event ) {
var curChar = String.fromCharCode( event.keyCode );
var inpStr = obj.value + curChar
window.status = '';
obj.title = '';
result = inpStr.match( '^[0-9]+$' );
if ( ! result ) {
window.status = 'Please enter only numbers.';
obj.title = window.status;
event.returnValue = false;
event.cancel = true;
}
}
|
|
|
|
|
There's regex in jscript ? '^[0-9]+\.?[0-9]?$' should do it. ( test for number, optional . and then optional number after the . )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
To match either an integer or floating point number, use this pattern:
^(\d+)|(\d*\.\d+)$
The first part (\d+) will match an integer, e.g. one or more digits.
The secont part (\d*\.\d+) will match a floating point number, e.g. optinal digits before the decimal point and one or more digits after.
---
b { font-weight: normal; }
|
|
|
|
|
I'm have a problem on vs 2005.
Well in vs2003 i'm use this code to return a type of assemblie
Type myType;
Regex reData;
string strData;
string strClass;
StreamReader srData;
srData = new StreamReader(strAspxFile);
strData = srData.ReadToEnd();
srData.Close();
reData = new Regex(@"Inherits=""(?<Inherits>[^""]*)");
if (reData.IsMatch(strData)){
strClass = reData.Match(strData).Groups["Inherits"].Value;
}
myType = Type.GetType(strClass + "," + strClass.Substring(0,strClass.IndexOf(".")));
Well in vs2003 the aspx files have this text Inherits="MyWebApp._default", but in VS2005 i'm have only the Inherits="_default".
The question is how i'm can get a type of assembly in vs2005?
Att.
excuses for english
|
|
|
|
|
This is an ASP.NET question.
Firstly, the problem is that you're doing things in a hacky way. You should use reflection to find the type of the assembly.
Secondly, you shouldn't declare all your variables at the top of a function unless you're using C.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thx to replay
I'm found the base.GetType() return the class _default but, when i'm try to use the code:
MethodInfo[] mi = myType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance |BindingFlags.DeclaredOnly);
the method GetMethods don't return the private member like the another way in vs 2003
if i'm use in vs 2005 MethodInfo[] mi = myType.GetMethods(); i'm get only the public members
how i'm can get the privates?
-- modified at 18:49 Wednesday 4th January, 2006
|
|
|
|
|
hello,
Is there a way to include the body attributes of an html document within the body and instead of inside the body tag?and leave the body tag as it is " ".
i need to do this because i'm developing an html editor that does not support body attributes and i need jave scripts to be included.
your help will be appreciated.
thank you.
|
|
|
|
|
Uh, you can add <script>s within <body>...
|
|
|
|
|
The short answer: "No, you can't."
The longer answer: Since you have deviated from the HTML standard by not handling BODY tags, then why don't you just invvent some of your own tags to handle the attributes and put them in the BODY tag?
|
|
|
|
|
How could I achieve this? It seems the only solution for me is to dynamically create a DataTable, adding the columns as I traverse the rows in the source, and inserting column sub-totals as I go on.
The DJ's took pills to stay awake and play for seven days. - Jim Morrison, Black Polished Chrome.
|
|
|
|
|
Hi!
We are running a webbased from in CGI from where email has sent to our register clint and our site also updated automatically. but the problem is currently when we sent email to our client they are getting junk emails due to us, because most of them share there personal email with us. our service is hamperring for that.
can any one give us any idea or suggession how we can prevent this problem?
Thanks in advance.
Sujata.
|
|
|
|
|
Can you explain the problem further? If I got you right, you have a CGI script that is sending mail? To whom? A client that is registering, or an already registered client? What do you mean by sharing email? Is it an email account or an email address that is shared? Why are the clients getting junk mail? From whom?
---
b { font-weight: normal; }
|
|
|
|
|
Ok,
I am answering one by one.
I have CGI script which is doing following job, making HTML pages, sending emails, store data to simple .dat file.
now, we maintain a email list through another cgi script, we go to that form and add all registerd user and make a email list using that cgi script and stored them in a .dat file. this email list contains 100 numbers of email address (not any account).
now first cgi script user this email list (in form of .dat file) and send email to all email address which are in this list.
now client who have provided us their emails address, complaining that when we send emails they got junk email along with that. some client has given only to us, their personal email address and from some days he/she is start getting junk email on his/her account.
Hope now its is clear to you.
sujata.
|
|
|
|
|
I see.
Well, sending mail normally should not expose the address to someone else.
Do you store the addresses in a publicly available file with an obvious name, like "http://www.mysite.com/mailinglist.dat"? Then someone might have scanned the web for files like that and found your.
---
b { font-weight: normal; }
|
|
|
|
|
Yes, we are doing exactly same. and if someone scann for the file and it will download automaticaly, like other dat file do.
Please suggest us what we suppose to do. Is change permission to that dat file will solve the problem?
Sujata.
|
|
|
|
|
The best thing would be to place the file outside the web folder. Then noone can browse to it.
Renaming the file would at least make it a lot harder to find. Give it a name that can't easily be guessed, like for an example "9873645981726301862051235.blurgh".
By changing the format of the file, you can make it impossible to access the contents. Consider this format:
<%@Language=VBscript%>
<%
'someone@site.com
'me@place.org
'them@location.net
'others@world.net
%>
Give the file the .asp extension, so that if someone tries to download it, the code inside the file will be executed. As the code only consists of comments, the result will be a blank page.
---
b { font-weight: normal; }
|
|
|
|
|
thanks for suggession. the file is one the Linux server so ASP will not work. I have chage all file permission and replace Public access and onlu give access permission to owner. now its working fine now no one can download or brows them through browser. only things is junk email sender got all email address. that cost lots to us.
I will try this method for another site on windows server.;)
Thanks a lot for your help and cooperation.
Sujata.
-- modified at 9:39 Thursday 12th January, 2006
|
|
|
|
|
Hi,
I'm using Report Web service to render reports.I've created drill down reports which are working fine in a local machine where reports server is installed,but when I run the reports on a client machine which doesnt have reports server it doesnt work.The reason being,the link on the main report points to the drill down report on the 'localhost',where as I want it to point to the server where the reports are deployed.I've tried using 'Jump to report' and 'Jump to URL'.When I use Jump to report,it is pointing to the localhost.when I use jump to url and give the entire url including the server path where the reports are deployed,it opens up the correct report on the server, but in a new window and that too in the Report server.Now I'm unable to figure out how to make the correct drill down report to open in my application window.
Any kind of help is highly appreaciated.Its very urgent.
Thanx a lot,
Sandhya.
|
|
|
|
|
Happy New Year!!!!
I wanted to know how to make my web based ASP.Net application an intranet application.I know i can use authentication/authorization to do it.But I donot want a login page or something along those lines.I just donot want any one who's not a member of the intranet to view the site.I also want to know how i can accomplish the same thing in ASP.Would appreciate if someone can help me out in this.
Thanks,
Aanchal.
|
|
|
|
|
Please don't double post.
---
b { font-weight: normal; }
|
|
|
|
|
Setup Windows authentication in IIS and the web.config file. That's it!
Michael Flanakin
Web Log
|
|
|
|
|
I'm trying to write a online HTML editor which is similar to FreeTextBox by myself. So far, I figured out that I can't use div with property contenteditable=true because I want it work with firefox and safari. I tried to make a div element that captures keys and print the key out in the div. But, this is not good at all.. cause there is no cursor available and things got too much complicated. Is there any better idea?
Thank you.
|
|
|
|
|
use FCKEditor in www.sf.net
Mikail Çetinkaya . The C# DEveloper
|
|
|
|
|
I have a big C++ desktop app. It needs to generate simple reports (10s of pages 10 items/page ).
The data is calculated inside the program, no database and the report is generated and viewed/printed inside the program.
I want the reports to be easily customisable and include images/fonts etc.
My plan was to generate the page as html and use a browser control to view them in the app.
It would create a separate javascript file containing all the data in arrays. The static html would read the .js file and format it using the values it needs from the array.
That way I don't have to write any parsing code.
Unfortunately the browser I am using can't do XSLT.
Any suggestions / comments ?
Martin
|
|
|
|
|
I am sure you can find several well established report generators for C++. Back in 1999 I used some version of Crystal that could easily embed images and provided some level of WYSIWYG layout editing and still used ADO to pull data.
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|