|
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
|
|
|
|
|
I have a web site that works fine on a Win 2003 server with IIS 6 and I am trying to move it to a server with Win 2008 and IIS 7.5. I am using Request.ServerVariables("LOGON_USER") to get the user who is currently logged in to the machine and in IIS 6 I have the "Integrated Authentication" option checked and this works fine. I cannot figure out how to get this to work on IIS 7.5. I have tried enabling Windows Authentication and it still brings up a password box. I want it to work the way it currently does and just open the page. I have the site added to my trusted sites in IE. I have also verified that "Automatic logon with current user name and password" is checked in the "Custom level..." settings for Trusted sites and Local intranet. Could it be something with the IUSR account on the Win 2008 machine?
I have been searching with Google for a couple hours now, can anyone point me in the right direction? Thank you.The woods are lovely, dark, and deep
But I have promises to keep
and lines to code before I sleep,
and lines to code before I sleep...
|
|
|
|
|
I have asp pages, and using vbscript. Does anyone know how I can retrieve the session variables using a session id? Or any other way of retrieving the session object from another session?
My problem is as follows:
I have a payment page where someone gives me credit card information etc.
I have to redirect them to a page on the bank's website for authentication. When they've authenticated themselves, the bank sends them back to one of my pages. Then I'm able to process the credit card transaction as normal. (This is part of a new security feature some banks use)
I use session variables to store the users details. Most of the time this works fine, but some devices, mostly mobile devices, create a new session when they are redirected back to me, then I'm unable to access the session variables.
I don't want to store credit card information in my database nor in a cookie, so I have use session variables. I can set the querystring that will be returned to me, I thought of saving the session id in the query string.
I've been banging my hesd against the wall for days now, still not closer to a solution.
|
|
|
|
|
Hi,
I recently made an application which was just a browser control in a winform app. It loaded a local file containing the necessary javascript code to load google earth globe on a document.
Document source:
http://code.google.com/apis/ajax/playground/#hello,_earth[^]
Everything worked like a charm until.
Recently google launched chrome frame whereby now inorder to run google earth on IE i have to install google frame. Ahan .. ok i did google earth started working again on IE np theres.
But using the .net webbrowser component it no longer renders the globe window. The plugin isn't loaded(the obvious case) once i load the document. I have added the meta tag as specified by google. but no luck.
I see that chrome launches as i navigate to earth page on a standalone IE browser. but it doesnot on my .net control navigation...
Any help Please
|
|
|
|
|
Hi there,
I'm using ASP.NET to send newsletter to some email addresses. the news letter is an html file with an image in its background. but the image cannot be displayed in Outlook 2003,2007.
Is it completely impossible to displaythe background in Office Outlook?
if not, what's the solution?
|
|
|
|
|
Do not post the same question to multiple forums
You have been around long enough to know this I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Difficulty using Ordered Lists in HTML tables
I can't figure out how to use Ordered Lists inside HTML tables.
The following is an Ordered List Outside of any HTML table:
1. Decimal type
2. Tea
3. Coca Cola
The Ordered List above is perfect, i.e., exactly what I want, when the list is outside of a table.
I can't figure out a way to keep the Ordered List numbering working (as shown above) when the Ordered List appears inside a table, as shown in the pdf file at this url:
"http://www.theadhdsolution.net/publicmisc/Difficulty%20using%20Ordered%20Lists%20in%20HTML%20tables.docx.pdf[^]"
I need the numbering to continue from the Left cell in the first row (in the table in the pdf) to the Left cell in the second row (in the pdf), to the left cell in the 3d row (in the pdf).
<html>
<head>
<title>My HTML application</title>
<HTA:APPLICATION
APPLICATIONNAME="My HTML application"
ID="MyHTMLapplication"
VERSION="1.0"/>
</style>
</head>
<script language="VBScript">
Sub Window_OnLoad
'This method will be called when the application loads
'Add your code here
End Sub
</script>
<font size ="4"><b><u>My Outline-Numbering Wish List</b></u>
<br>
<ol>
<li>Decimal type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
<br>
<br>
<table cellspacing=1 cellpadding=3 bgcolor="black">
<tr>
<td bgcolor="white">
<ol><li>Decimal type</li>
</td>
<td bgcolor="white">
Right Column
</td>
</tr></ol>
<td bgcolor="white">
<ol><li>Tea<br><-- I wish that that the "1" could be replaced with a "2"</li>
</td>
<td bgcolor="white">
Right Column
</td>
</tr></ol>
<td bgcolor="white">
<ol><li>Coca Cola<br><-- I wish that that the "1" could be replaced with a "3"</li>
</td>
<td bgcolor="white">
Right Column
</td>
</tr></ol>
</table>
<br>
<table cellspacing=1 cellpadding=3 bgcolor="black">
<tr>
<td bgcolor="white">
<ol>
<li>First One</li>
</td>
<td bgcolor="white">
<li><-- I wish that that were a "2"</li>
</td>
</tr>
<tr>
<td bgcolor="white">
<li><-- I wish that that were a "3"</li>
</td>
<td bgcolor="white">
<li>Whoops. One too many</li>
</td>
</tr>
</table></ol>
</body>
</html>
|
|
|
|
|
You can't split the list between cells and rows, put it in one cell I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks for the reply. What book did you read that said that? Do you recall what page the info was on?
My problem is that I need the list numbering to work across cells, as opposed to being limited to working only inside one cell.
If it becomes clear to me that the < ol > < li >item< /li > approach won't work, then I'll have to hunt around for some other solution. Do you have any suggestions?
Anyway, thanks for your time and effort.
Barry
|
|
|
|
|
It wasn't in a book, it's in the specification from W3C. You can use OL/LI but you can't use it with a table as you would like.
As suggested you can use CSS to apply the formating like a table. I know the language. I've read a book. - _Madmatt
|
|
|
|