im very new to javascript, and writing this script to add up a shopping cart and print out subtotals and totals. it works in FF but not in IE. this function is called by onclick of one of three select options with a value of 0-25. it is in a js file called in the head. what it does is get the selected values as variables, parseint them, adds and multiplies, and changes the innerHTML of the table to reflect the subtotals, and total. FF does it great, but IE gives Nan. ive tried rewriting it a number of different ways, and many translations still work in FF but not IE8. ive made sure the variables and form id's arent repeated.
function gen_invoice() {
var scount = parseInt(document.shopcart.studentcount.value, 10);
var ycount = parseInt(document.shopcart.youthcount.value, 10);
var fcount = parseInt(document.shopcart.facultycount.value, 10);
//html output source is 3 selects like this, with diff ids and names:
//<select name="studentcount" id="studentcount">
//<option onclick="gen_invoice()" value="0">0 </option></select>
var cardcost = parseInt(document.shopcart.cardprice.value, 10);
//cardcost comes from hidden input value:
//<input type="hidden" id="cardprice" name="cardprice" value="25">
var totalsum = scount + ycount + fcount;
var grandtotal = totalsum * cardcost;
document.getElementById('s_price').innerHTML = scount * cardcost;
document.getElementById('y_price').innerHTML = ycount * cardcost;
document.getElementById('f_price').innerHTML = fcount * cardcost;
document.getElementById('grand').innerHTML = grandtotal;
//....
}
...after this there are 3 long loops for writing out some other forms, but they dont work in IE either because they depend on the selected values to be an integer. this part happens first and returns Nan, so im sure the problem is here somwhere.
I have literally hit my head on the table over this. You can imagine how frustrating it is to be able to write the entire rest of the site beautifully, but then fail at adding 3 numbers together. help please!
Hi there,
Im developing a 3d Viewer in vb.net and xna. Its working very well.
I have now a windows form and a xna render window, but i would like to render it inside a panel in the windows form.
I have searching for info, but its so hard to addapt it into my application.
How can i do it?
Here is the application
Thank you.
Image: img299.imageshack.us/img299/384/87117064.jpg
Im using following CSS to set a background-image for my menu
#menuContainer
{
background:url('../images/main-bg.png') repeat-x;
}
My CSS is inside
~/styles/site.css
and my image is inside
~/images/main-bg.png
The problem is this works perfectly in Chrome but it's not working in Firefox.
But if change the URL to
#menuContainer
{
background:url('images/main-bg.png') repeat-x;
}
It starts working in Firefox and in Chrome it doesn't work.
Can anyone please help?
Hi all,
In my project im using numeric up down extender, when i run my program numeric up down extender was displayed in firefox but not in Internet explorer 8. Give me a solution.
how does one use code to do this:
produce 15 random numbers that are not in any order, and that only occur once
eg.
1 4, 2, 5, 3, 6, 8, 7, 9, 10, 13, 12, 15, 14, 11
rand() or arc4rand() can repeat some, which is not what im after.
Thanks
Im using linq-sql .I have 3 tables. e.g
Project, People and a ProjectsPeople(fk's ProjectID and PeopleID) (junction) Table.
given a set of peopleIDArray (an array of ints as people ID's)
how can i get only Projects that have atleast one of the peopleId's associated with them?
i.e there will be atleast one (may be more) record in the ProjectsPeople table that will have a ProjectId and an id from the peopleIDArray )
thanks
Hi, im just writing my own replace method for any weird characters and i used the ASCI value 0, null to replace unwanted characters, i was hoping for them to be 'deleted', but this doesnt work. A gap just appears in the string.
What exactly does String.Replace() do when removing a character for ""? Does it shift them all down and then 'delete' the final character or something?
I dont see any direct mention on using multiple slugs (or any behavior for that matter) for single model. Is there a way to use the sluggable behavior to generate two separate slugs for a model?
For example i need to generate two slugs for every record a product_id consisting of a slugified company name and sku and a distributor_id consisting of a different slugified company name.
Obviously i could write this myself fairly easily, im just wondering if this can be done quickly with Sluggable.
I am creating a booking module using MOSS 2007.What i would like to know is that is it possible to create a webart that will show only the Daily view ,which will be connected to the central Calender..
Basically what im trying to achieve is this.
Each Room must have its own webpart that shows the bookings only associated with that room,so ultimately you might have two rooms that are booked at 8:PM(Same Day) showing on the central Booking calender.....
Help would be appreciated
as title said, Im trying to change only the first occurrence of word.By using
sed 's/this/that/' file.txt
though i'm not using g option it replace entire file. How to fix this.?
UPDATE:
$ cat file.txt
first line
this
this
this
this
$ sed -e '1s/this/that/;t' file.txt
first line
this // ------> I want to change only this "this" to "that" :)
this
this
this
do you got the solution for your problem ?
im working on the exact same thing and cant get it to work...
if u could post the solution, it would be much appreciated :o
greetingz
msn: [email protected]
steam : [email protected]
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
if(petDetails.getDateOfDeath() != null){
String formatedDateOfDeath = formatter.format(petDetails.getDateOfDeath());
String formateDateOfBirth = formatter.format(petDetails.getDateOfBirth());
}
How can i calculate the age of death from the above. I dont want to use any externallibraries
EDIT: please look at what I've got so far.none of the other threads are like mine. most of them are about date from DOB to today and not in the format im using.
Ok what i need is help..haha ok im making a music app with a paino but i need to be able to hold the sound long or short. So like if i hold a button it will start playing the sound but if i let go it stops WITH A FADE so how ever long i hold the button down that is how long the sound will play (that is ntill the sound ends)
Hi All,
I have multiple letters in html format in a folder and im list those letters in the gridview on ASP.NET page if user select couple of letters and click print i should me those letters
Now Question is how to print multiple html files on the event of button click.
id like it so when i check out a file no one else can edit it until i check it back in. is there a version control that allows me to do this? i currently use subversion and i know it has the 'lock' feature but i want it to do that automatically without me having to request it on each file im working on.
Im not sure how to reference to JPanel when it was declared like this, I had someone else help me on JPanels and this is the code he used:
final JFrame frame = new JFrame("CIT Test Program");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setPreferredSize(new Dimension(350, 250));
frame.add(new JPanel()
{{
Not sure how to reference to JPanel to use BorderLayout.
How would I go about doing this?
hi i was going to start leaning php and i cant setup a server is there a good emulator that will show me what im writing without having to run or be part of a server
Im using c# .net windows form application. I have two comboboxes A and B .I have pouplated A with some values. Now if i select any one value from A, I should be able to populate B with all the items of A except the selected item .
I have a url which looks like this
https://test.high.com/people/11111111-name-firstname-_custa/deals/new
Now i need to match document.URL
if im on that Page if so i will alert a message.
The important part is /deals/new
How can i match that in Javascript?
Hi all, im trying to get image size(DIMENSIONS) of hundreds of remote images and getimagesize is way too slow. ive done some reading and found out the quickest way would be to use get_file_contents to read a certain aount of bytes from the images and examining the size within the binary data. Anyone attempted this before? How would i examine different formats. Seen any library for this? please let me know
Hello Im currently writing a product syncronisation script for magento. I know how to add a new product with a given atribute set. However one of the atributes i am using is a size field. When a new size is encounterd I want to add this option to the attribute, I am wondering how to do this please?
How can I check if a user exists?
Im doing an installer for a mysql database, and I need to check if a user exits, if not create user, if yes delete user and create it again.
this so i can execute the script without worries.
thanks.
Im making an app, and i want it to make a sound when a activity is opened , the sound file is in R.raw.sound_file , if someone could do some example code to make my app play a sound that would be great :)
hi. im new in MATLAB.
i think its a simple question.
i want:
a=1.154648126486416
to become
a=1.154
and not
a=1.54000000000
how do i do that without useing format('bank').
thanks.