|
Hi!
How can I check the validation of the email by searching '@' character inside of document.getElementById('email').value
or does anybody have better idea?
|
|
|
|
|
I've come at this from a .NET approach so it'd just be a regular expression validator control with the expression:
"^([\w\-\.]+)@((\[([0-9]{1,3}\.){3}[0-9]{1,3}\])|(([\w\-]+\.)+)([a-zA-Z]{2,4}))$"
There's quite a few at regexlib.com if that doesn't match what you want, judging by your original question, I'm assuming you might just be working solely in javascript in which case, same expression should work with the javascript regular expression object but it's not one I've used.
|
|
|
|
|
|
I recently got a new computer and am now running Windows 7, which I'm not very familiar with (previously on XP).
I have imported a couple of web applications from my old box but I am having problems accessing ASP pages. That's old fashioned ASP, not .NET. I constantly get Error 403.1 even though I have checked that all folders within my InetPub folder have execute access enabled.
Actually, not quite all. I have discovered that if I set up an ASP page at the top level then the following works:
http://LocalHost/Test.asp
but the same test page one level down fails:
http://LocalHost/BBL/Test.asp gives 403.1 error.
I have tried grovelling around in IIS manager but it's all changed since I last used it in anger. Under Sites I have "Default Web Site" and under that BBL as a web application. I have right clicked on BBL and chosen Edit Permissions... and all the listed users, including IUSR and IIS_IUSRS, have read and execute permissions checked. The underlying Windows directory also has execute permission. What have I missed here? How do I make the ASP pages within my application work correctly?
|
|
|
|
|
|
Dave
Thanks for your suggestion but the link in your posting just takes me back to the current thread. Is there something missing?
Keith
|
|
|
|
|
|
Thanks Dave
I right clicked the BBL folder in Windows explorer, chose properties then permissions and set Read/Execute access on for IIS_WPG as suggested and it still doesn't work. So I set Read/Execute access for Everyone and still it fails.
I tried setting permissions on the actual ASP file and most were greyed so I couldn't change them (but Read/Execute was already set). I added Everyone to the list of users and gave Everyone Read/Execute permission and still my ASP script won't run.
I am beginning to tear out what little hair I've got left. Is there some setting in IIS manager that I'm missing?
Keith
|
|
|
|
|
Hello,
How can I call internet explorer or any standard browser on system from my VC++ program.
I want to go to my Home page with a button click. So simple ! but I can't.
thankyou!
|
|
|
|
|
What have you tried? This would probably be better asked in the C++ forum I know the language. I've read a book. - _Madmatt
|
|
|
|
|
The MSDN documentation[^] on Process.Start has a fine example of how to do this in VC++, although this launches a specified web page rather than your home page.
|
|
|
|
|
|
Hi there, I really hope you can help I have worked on this all day today and last night. I can't get the Total box to calculate. I am trying to create an online invoice for my customer to print from my web page. I have scoured the internet looking for some help, but it doesn't help that I am clueless about javascript. This is what I have tried: In my table, all I want to happen is for the user to type in a price in the Amount boxes and then have a total at the bottom. Seems pretty basic, but I just don't understand why it won't work (not really sure of what I am doing)
Can somebody please help me?
The form itself can be found at www.ahtcsonline.com/invoice.html - the source is too much to copy so it may be easier to view the form and then view the source code underneath it.
Thank you in advance,
Evan
<script type="text/javascript">
function totalamountdue(){
{
var amount, amount2, amount3, amount4, amount5, amount6, amount7, amount8, amount9, amount10;
Amount = document.Invamt.Amount.value;
Amount2 = document.Invamt.Amount2.value;
Amount3 = document.Invamt.Amount3.value;
Amount4 = document.Invamt.Amount4.value;
Amount5 = document.Invamt.Amount5.value;
Amount6 = document.Invamt.Amount6.value;
Amount7 = document.Invamt.Amount7.value;
Amount8 = document.Invamt.Amount8.value;
Amount9 = document.Invamt.Amount9.value;
Amount10 = document.Invamt.Amount10.value;
Total = document.Invamt.Total.value;
document.Invamt.Total.value = (amount + amount2 + amount3 + amount4 + amount5 + amount6 + amount7 + amount8 + amount9 + amount10);
}
}
</script>
|
|
|
|
|
Try this:
function totalamountdue(){
var Amount = document.getElementById("Amount").value;
var Amount2 = document.getElementById("Amount2").value;
var Amount3 = document.getElementById("Amount3").value;
var Amount4 = document.getElementById("Amount4").value;
var Amount5 = document.getElementById("Amount5").value;
var Amount6 = document.getElementById("Amount6").value;
var Amount7 = document.getElementById("Amount7").value;
var Amount8 = document.getElementById("Amount8").value;
var Amount9 = document.getElementById("Amount9").value;
var Amount10 = document.getElementById("Amount10").value;
document.getElementById("Total").value = amount + amount2 + amount3 + amount4 + amount5 + amount6 + amount7 + amount8 + amount9 + amount10;
}
We really should add some error handling and/or only allow numbers in the text boxes.
|
|
|
|
|
Hi There Jason, I wished it worked, I was really hoping but nothing calculated when I hit the "calculate" button. I want you to also know that I have tried so many iterations before I asked for help. I am very tenacious and still looked on the net after my submission. Wish I knew what I was doing but I truly think that the subject is over my head. Although I did create my website from scratch back in August and I knew nothing of HTML...not that I know that much now
Thank you for trying,
Evan
|
|
|
|
|
<pre>function totalamountdue() {
var inputs = document.getElementsByTagName("INPUT");
var runningTotal = 0;
for (i = 0; i &lt; inputs.length; i++) {
if (inputs[i].id == "total") {
inputs[i].value = runningTotal / 100;
var a = inputs[i].value.split(".");
if (!a[1]) {inputs[i].value += ".00"}
else if (a[1].indexOf("0") != 0 &amp;&amp; a[1] &lt; 10) { inputs[i].value += "0" }
}
if (inputs[i].id.indexOf("Amount") == 0) {
if (/^[1-9][0-9]{0,2}(,[0-9]{3})*(\.[0-9]{2})?$/.test(inputs[i].value)) {
runningTotal += +inputs[i].value * 100;
} else {
if (inputs[i].value == "THIS IS A BAD VALUE") { inputs[i].value = ""; }
if (inputs[i].value) { inputs[i].value = "THIS IS A BAD VALUE"; }
}
}
}
} <></pre>
-- Modified Friday, February 26, 2010 1:35 AM
|
|
|
|
|
Dave, I could hug you...or just give you five! Thank you and the previous person, Jason for all of your efforts. I hate to ask for help, but there was no way I was going to get this one. Sometimes I come up with these ambitious ideas but with no way to implement them.
Thank you very much,
Evan Einhorn
|
|
|
|
|
|
function totalamountdue() {
var inputs = document.getElementsByTagName("INPUT");
var runningTotal = 0;
for (i = 0; i < inputs.length; i++) {
if (inputs[i].id == "total") {
inputs[i].value = runningTotal / 100;
var a = inputs[i].value.split(".");
if (!a[1]) {inputs[i].value += ".00"}
else if (a[1].indexOf("0") != 0 && a[1] < 10) { inputs[i].value += "0" }
}
if (inputs[i].id.indexOf("Amount") == 0) {
if (/^[1-9][0-9]{0,2}(,[0-9]{3})*(\.[0-9]{2})?$/.test(inputs[i].value)) {
runningTotal += +inputs[i].value * 100;
} else {
if (inputs[i].value == "THIS IS A BAD VALUE") { inputs[i].value = ""; }
if (inputs[i].value) { inputs[i].value = "THIS IS A BAD VALUE"; }
}
}
}
}
|
|
|
|
|
I know you have already been given a solution to this, but I just thought I give you an important tip. This didn't work because you are declaring and adding variables with a lowercase 'a' in amount, but assigning the values to an uppercase Amount. This makes them different variables. Amount != amount. JavaScript is case sensitive. Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|
|
Hi Boro_Bob, I really appreciate the information. Last August I lost my job and then decided that I would do my own thing. I knew I needed a website so I started working on it. I knew absolutely nothing about HTML. Little by little I have learned along the way and I borrowed lots of code I found on the net but only employed it if I could get it to work. Instructions varied so if it worked great if not I moved on. Javascript...not a clue. But again I scoured the internet to make my column add up and tried many different iterations. I should have known what you said to be true about the code being case sensitive...as it is true for HTML. During the course of building my website I had decided to capitalize the first letter of the file names when I was done editing so I could keep track of what was done. Lesson learned, never capitalize the "I" in index.html or it will give you a 404 Error code and the Home page won't work.LOL. My web page has been about scope creep, every time I get something to work I then think of something to make it better. For instance, the columns adding up now works great...my next idea was to have drop downs with the 3 or so varying amounts I charge for my online classes. You know I had to try it but since I don't know squat about JS I gave up my idea.
Again I want to say "thank you" for explaining that JS was case sensitive. I tried like hell to figure it out on my own and that never dawned on me.
Evan Einhorn
www.AHTCSonline.com
|
|
|
|
|
No problem. Good luck with your site. Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|
|
Hey guys, I am wondering if anyone knows some javascript code to lockup a web page for a given amount of time. I am doing some testing on my cell phone. Whether it be by a bug in some code or using an infinite loop of calculations to "lockup" the memory, etc. I don't know javascript that well to create a command loop...
I did find this link[^] but couldn't get it working.
I hope someone can shed some light. Thanks in advance.
|
|
|
|
|
I am making a website in hindi using ASP ,but whenever i want to retrieve data dynamically from MS Access database,it either shows ?????? or some junk value or some awkward characters of other language..
I want to know what all i can do to make it run..
|
|
|
|
|
Hi Jyoti,
Have you set the globalization properties in your web.config like so?
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8" />
There is an article here[^] that might assist you.
Cheers,
Daniel
|
|
|
|