|
Dear all, i need to do a javascript validation for a textbox,
this textbox is for the amount, the user can enter for example the value: 2 or 3.2 or 0.7
I should allow him to enter a digit and also ".", what is the simplest regular expression to do this.
The developer that worked previously on this project, put this regular expression:
var objRegExp = /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/; I can't understand it specially the -? in the begining of each part, what exactly do the "-?" and also for which validation this regular expression is used.
Thanks.
|
|
|
|
|
The -? means a minus (-) or none minussign.
I think the most simple regexp is:
(^-?\d+(\.\d*)?$)|(^-?\d*(\.\d+)?$)
This will allow also number like .7 and -.3
A little simpler is:
^-?\d+(\.\d*)?$
This does not allow .7 or -.3 but it will allow 0.7 and -0.3
Wout Louwers
-- modified at 7:39 Thursday 8th June, 2006
|
|
|
|
|
hi all i want to know the reason why when i design a web page using the dream weaver and add it to ASP.Net 2003 as aspx form
all the controls comes black specially those made as flash SWF files
i also want to know how to add a flash banner or in any part of the page
thank u all
abdelhameed81
|
|
|
|
|
i try to look for a asp.net free space a long time,but no use.Dear!help me?!
|
|
|
|
|
|
|
|
I'm using IE7 Javascript library to make my IE6 browser more compliant. The library is being used on a Rainbow Portal .NET v1.5 website which has the layout/theme Zen-starter active. The problem is when I have the library active for the page and mixed with this theme/layout setting IE6 (for Windows XP/2K) completely locks up. Firefox works perfectly fine and quickly.
The webpage attempts to display a dropdown menu making heavy use of CSS and , - tags. From my investigation, the standard CSS Hover pseudo attrib is being used, which I figure is the reason for IE7's usage (to translate all HOVER attribs to a JS equiv for IE6). I've disabled the IE7 library and IE6 eventually displays the page without locking up. I've used:
TIDY.EXE -ascii -i -f errors.txt -m PageFreeze.htm
to cleanup the HTML and match up any possibly missing tags but still the same effect. I've even copied the text into W3C's Validator without luck. One thing i did notice is that the IE6 browser does freeze preventing me from dragging the scrollbar or anything else within the entire browser (insisting on being END PROCESSED) but eventually (after 5 mins or more) the web page menu system appears, however when i hover my mouse over it the entire screen freezes again, and after another 5 mins or more the menu dropdown appears. This occurs for each menu item i hover over.
Please, does anyone have any clues on why this locking up is occurring and its resolution?
You can see the test page here:
(This page does not freeze IE6 because IE7 Library has been disabled in tags): http://www.spunge.org/~tony/help3/PageNoFreeze.htm
(This page freezes IE6. IE7 Library is enabled in tags): http://www.spunge.org/~tony/help3/PageFreeze.htm
(This page momentarily freezes IE6 but only contains a single menu item): http://www.spunge.org/~tony/help3/PageSingleMenuNoFreeze.htm
The pages need to not freeze and show dropdown menus if all is ok. Just a oddity, notice that when you hover over Government and it underlines the word. It seems to take a second longer than when the underline is placed beneath other words. Also I've tried removing much of the UL/LI menu items and leaving one or two and the freezing of IE has gone down from 5 mins+ to a few seconds and the menu dropdown appears. Again, Im suspecting the depth of the menu system and IE7 library are at fault. But a solution to have the menus in full is what Im after.
Thank you.
|
|
|
|
|
I have create activex control with following command on button click. ConsoleTest.exe is .net application.
Private Sub cmdLaunchApp_Click()
Shell (App.Path & "\ConsoleTest.exe")
End Sub
I have included activex control in html page with following tag.
<object classid="clsid:C429A323-8D83-4D4D-9BF9-EAB9F5CA705E#consoleTest.exe" codebase="http://kumar/actx/LaunchApp.ocx">
When this page is accessed on client. It display activex button but instead of calling exe file it display message like File not found.
Any body help us to resolve this problem
Kumar Prabhakar
|
|
|
|
|
Hi,
A little background on the application first. It is a .NET 2.0 win forms app which connects to a .NET 2.0 web service using WSE 3.0. When the user makes requests to login, a login method is called on the web reference. If this throws an error, an attempt is made to log the error to a database using another method on the web reference. If this fails enterprise exception handling takes over and the error is logged to a local file. Proxy details are set on the web reference before any methods are called (see code at end).
The Problem:
When the user tries to login an error is thrown stating proxy access denied, an attempt is then made to log this error causing another proxy access denied error. Finally this error is logged in a local text file.
The Bizare Part:
Even with the errors described above, the web service still records in the DB that the user logged in, and still records in the error log table "Proxy Access Denied" even though it had to go through the proxy to record the login and to log that error???
The Exact Error (logged in the database using the web service):
System.Net.WebException: The request failed with HTTP status 407: Proxy Access Denied. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at xx.Input.localhost.xxServicesWse.GetLoginData(String userName, String password) at xx.Input.Data.UserDataManager.login(String uName, String pWrd) at xx.Input.GUI.xxInput.loginInterface_login(Object sender, LoginArgs le)
Where do I go from here to solve this proxy problem. Note that testing the system on a network without a proxy works fine, even if the client contacts the web service accross the internet.
The Code: (returns the web reference used through the client)
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using xx.Input.localhost;<br />
using System.Net;<br />
<br />
namespace xx.Input.Web_Service<br />
{<br />
internal class ServiceProxyFactory<br />
{<br />
public static xxServicesWse GetxxService()<br />
{<br />
xxServicesWse xxServices = new xxServicesWse();<br />
<br />
System.Net.CookieContainer cookies = new System.Net.CookieContainer();<br />
xxServices.CookieContainer = cookies;<br />
<br />
WebProxy myProxy = new WebProxy();<br />
myProxy.BypassProxyOnLocal = true;<br />
string proxyAddress = System.Configuration.ConfigurationManager.AppSettings["proxyAddress"];<br />
if (proxyAddress != null && !proxyAddress.Equals(""))<br />
{<br />
myProxy.Address = new Uri(proxyAddress);<br />
string proxyUsername = System.Configuration.ConfigurationManager.AppSettings["proxyUserName"];<br />
string proxyPassword = System.Configuration.ConfigurationManager.AppSettings["proxyPassword"];<br />
string proxyDomain = System.Configuration.ConfigurationManager.AppSettings["proxyDomain"];<br />
myProxy.Credentials = new NetworkCredential(proxyUsername, proxyPassword, proxyDomain);<br />
}<br />
else<br />
{<br />
myProxy.Credentials = CredentialCache.DefaultCredentials;<br />
}<br />
xxServices.Proxy = myProxy;<br />
<br />
return xxServices;<br />
}<br />
}<br />
}
|
|
|
|
|
The following code seems to work:
<br />
IWebProxy iwp20 = WebRequest.DefaultWebProxy;<br />
string requestURL = Properties.Settings.Default.xxInput_localhost_xxServices;<br />
string proxyAddress = iwp20.GetProxy(new Uri(requestURL)).ToString();<br />
if (!proxyAddress.Equals(requestURL))<br />
{<br />
WebProxy myProxy = new WebProxy();<br />
myProxy.Address = new Uri(proxyAddress);<br />
myProxy.Credentials = CredentialCache.DefaultCredentials;<br />
xxServices.Proxy = myProxy;<br />
} <br />
Now I just have to figure out how to get the auto upgrade feature of click once deployment working through the proxy server.
|
|
|
|
|
Heres a question...
I have a series of web services and applications being served from IIS 5. Now I would like to create stats on the amount of hits etc to these endpoints. Something like AWStats.
A relatively simple task, however:
- I do not want to install any other backends, therefore I cant use AWStats as it requires perl
- I would like to be able to serve the stats via a webpage, therefore I cant easily use Microsofts Log Parser
In essence I want an AWStats clone written in ASP .NET or ASP
Does anybody have any suggestions on possible solutions?
|
|
|
|
|
i want to fill a drop down box using data retrieved from access database.......
i alread know how to connect and retrieve data from the database but i am a lil unsure as to how i can populate the drop down list with the values retrieved
kenny
|
|
|
|
|
I think you have to output the OPTION tags "by hand" in classic ASP.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
dynamically like this:
<SELECT id=cmbHelp>
<OPTION value="0">-Select - </OPTION>
<%do while not MyRs.EOF %>
<OPTION value="<%=MyRs("id")%>"><%=MyRs("name")%> </OPTION>
<%MyRs.MoveNext
loop%>
</SELECT>
or for none database driven content
<SELECT id=cmbHelp>
<OPTION value="0">-Select - </OPTION>
<OPTION value="1"> item1</OPTION>
<OPTION value="2">item2 </OPTION>
</SELECT>
none
|
|
|
|
|
Got this question - I am working in a company that has been using VS2003 and the older .NET framework for all its projects; I want to experiment with web-development, ASP 2.0 but I am wary of any compatibility problems. If I install the 2.0 SDK and continue to use VS2003 and projects developed in previous .NET, should everything be fine?
Thanks in advance..
|
|
|
|
|
If you are thinking about developing .NET 2.0 applications in VS2003 then you are wrong.
But yes you can have VS2003 and VS2005 installed on the same computer without any problems (I have this setup here at work and it works)
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
You cannot use VS2003 to build a .Net 2.0 application.
You can use the free Visual Studio Express[^] to build your application though.
Edbert
Sydney, Australia
|
|
|
|
|
IN ASP
If we use ENCTYPE attribute in form tag for example
...(because its neccessary to use for file uploading)
then we cannot get form;s object values using REQUEST object.
My question is this how can we get the value of form object on next page if we use ENCTYPE attribute in form TAG
|
|
|
|
|
Hiya all.
I stumpled on a problem one of my coworkers were having today, in that he'd like to fire an onMouseOver event on each option in a select-object.
What ideally would should happen was that an image would be changed when the mouse hovers over the options in a select. This can be done with FireFox, but not with IE, by using onMouseOver on each option.
something along this line:
<select>
<option onMouseOver="doStuff(1)">Option 1</option>
<option onMouseOver="doStuff(2)">Option 2</option>
</select>
Now this works in FireFox, but unfortunally in IE, which is what the client is going to use.
Does anybody know of a work-around or possible alternative implementation to this problem?
With regards
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
Hi,
You can perform the check in the select onChange event.
Something like this:
<code><script language="javascript">
function selectExp()
{
alert(document.getElementById('ddlTest').options[document.getElementById('ddlTest').selectedIndex].value);
}
</script>
<SELECT id="ddlTest" ONCHANGE="selectExp();">
<OPTION value=1 selected>first</OPTION>
<OPTION value=2>second</OPTION>
<OPTION value=3>third</OPTION>
<OPTION value=4>fourth</OPTION>
<OPTION value=5>fifth</OPTION>
<OPTION value=6>sixth</OPTION>
<OPTION value=7>seventh</OPTION>
<OPTION value=8>eighth</OPTION>
<OPTION value=9>ninth</OPTION>
<OPTION value=10>tenth</OPTION>
</SELECT></code>
This wey you get the selected index or its value , accordingly you can put the code for different options.
I hope this works for you.
Thanks
Sushant Duggal.
|
|
|
|
|
Thanks for the reply.
The problem is that onChange dosen't fire until after the selection has been changed in which case the page changes, whereas the onMouseOver in Firefox would trigger as you use your mouse to "scroll" down the selection-choices, and you'd be able to see a preview before making the selection.
I am "fearing"/thinking that we do need to go with an "onChange" to have compatibility with Internet Explorer, but seeing as this was a client request (*sigh*) I thought it was worth to see if there was a workaround for IE, to mimic the behaviour we see in Firefox.
But thanks for your reply.
With regards.
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
Newb brainer question;
working in c# 2005, doing an asp.net webpage. This seems to be more of an HTML or formatting issue but I thought this was the best place to ask. After writing a basic page with standard html code, I noticed that when I view the webpage in browser, and I resize the screen, the text will stay within the baorder of that window. It basicly won't stay put. I checked all the settings I could think of minus the use of Text boxes.
It seems like a rather basic answer because I can go to any other webpage and the text and page flow stays. any thoughts?
Apps programmer exploring the fun world of webbing.
/////////////////
Thus spake the master programmer:
``A well-written program is its own heaven; a poorly-written program is its own hell.''
|
|
|
|
|
So the text stays withing the border of the window? Isn't is supposed to do that? Where do you want the text to go?
---
b { font-weight: normal; }
|
|
|
|
|
just thought of it; it behaves like a "wordwrap" when you resize the screen. when I type in here, the words move till end of box, with wordwarp, end of size of window. a bit more clearer now? Sorry, just having trouble discribing this, though "wordwarp" is closest I can come up with.
/////////////////
Thus spake the master programmer:
``A well-written program is its own heaven; a poorly-written program is its own hell.''
|
|
|
|