Jump to content

Patrick

Members
  • Posts

    18
  • Joined

  • Last visited

About Patrick

  • Birthday 03/05/1988

Previous Fields

  • Languages
    HTML, HTML DOM, CSS, JavaScript, AJAX, ASP, ADO, SQL

Contact Methods

  • Website URL
    http://www.p-s-p.dk/patrick
  • ICQ
    0

Profile Information

  • Location
    Denmark

Patrick's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. 1) but for the 2nd row onwards.... its taking the same first row value to compute the total.That's because when you add a product you use the same id for the inputs. You need to add an integer to that id to be able to access the values.2) while removing last row ... i m not able to compute gTot (Net Total) appropriately.Well again you need to add an integer to the ids to even be able to get into the right input and get the value. And next you'll get a problem where you can't access the input because you're doing this:tbl.deleteRow(lastRow - 1);var del = document.getElementById('txtTot').valueAfter deleting the row you want to access the input in that row you just deleted which you can't for good reasons. Just put the last line first after adding an integer to the id.3) How can i remove perticular row... from the between?In your remRow() function you have the following line:tbl.deleteRow(lastRow - 1);Simply change the parameter passed to it. So if you want to remove the second row from the bottom change it to "lastRow - 2".4) selected product has to be removed from appearing for the following rows.If you start adding multiple rows without selecting a product you won't be able to remove the product obviously. And besides you can alter the product chosen at any time so removing an option might not be that good an idea.If you want to do it: Every time a client selects a product you should have a function check if that product is already selected and if so you should change the product back and alert the client.Or: Every time a client selects a product you should have a function remove that option from the other product lists.CommentsThe way you're calculating the gtot isn't really working. Every time you click on a "Total"-input or ust tab to move through the inputs you'll add the total to the gtot even if it's already in the total sum. Instead you should have a function add the "Total"-inpus on the onfocus event, it'll be a little heavier, but it'll work properly.
  2. You weren't that far from a working solution <html><head><title>Page title</title><script>function Change(){ document.c_form.B.click();}</script></head><body onload="Change()"> <form name="c_form"> A<input type="radio" id="A" name="nclass" value="A"> B<input type="radio" id="B" name="nclass" value="B"> C<input type="radio" id="C" name="nclass" value="C"> D<input type="radio" id="D" name="nclass" value="D"> </form></body></html> I added an id attribute to your inputs and used the method click() to select B.
  3. <a href="somelink.htm"><img src="pic1.jpg" onmouseover="this.src = 'pic2.jpg'" onmouseout="this.src = 'pic1.jpg'"></a>Like that?
  4. Patrick

    help me!!!

    I'd say the problem is aswell the fact that there is no "end if".<% If Request.Querystring("id_map") = "1" Then Response.Write "<img src='images/spinstar.gif'>" end if %>
  5. To me the following code doesn't give any scrollbars in neither Firefox 2 nor IE 7:<html> <head> <style type="text/css"> body { overflow: hidden; } </style> </head> <body> <p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p> </body></html> But if you've still got that problem it might be because a browser doesn't consider anything overflow unless you tell it which height and width the body should have. And as you can't change the height and width of the body you might want to put all the content in a div and do it like this: <html> <head> <style type="text/css"> div { width: 50%; height: 50%; overflow: hidden; } </style> </head> <body> <div><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p></div> </body></html>
  6. Well I'd use a simple <div> for that. You'll probably get my point from this code: <html> <head> <script type="text/javascript"> function showBox(obj) { document.getElementById("box").style.display = "inline"; } function hideBox() { document.getElementById("box").style.display = "none"; } </script> </head> <body> <p onmouseover="showBox(this)" onmouseout="hideBox()" style="cursor: pointer;">When your mouse is over this...</p> <div id="box" style="padding: 5px; border: 3px solid #9999FF; position: absolute; display: none; z-index: 10;">... it shows a box.</div> </body></html>
  7. Does it say a linenumber?I dunno if you just didn't copy all of it, but you have an "end if" statement, and there's no "if" statement in the beginning.
  8. I'd do something like this:<%counterNum = 0Do While Not rsP.EOFcounterNum = counterNum + 1 %>...Whatever should be written about the specific product comes here...<a href="java script:SubmitForm('AddToBasket',<%= counterNum %>)"><font color="#000000">Add to basket</font></a><%rsP.MoveNextLoop %> This will make the recordset loop through every record and add one to the counterNum for every record.
  9. Try this instead:c2.onchange = new Function(replaceWord(inc1, (i - 1), r, (total - 1)))
  10. Well that's in the ASP part of the file. I don't know if you're looping through the different products with For ... Next or Do ... Loop?
  11. Personally I'd start of by writing "java script:" in one word if you aren't already doing so?
  12. The problem which makes this NOT work is the "java script:" in the beginning of the onmouseover event. Either type it "java script:" (in one word, but this forum automatically splits the word in two) or completely remove that part as below, and this works in both Firefox and IE to me:<p onmouseover="this.style.color='blue'" onmouseout="this.style.color='red'" style="color: red;">Testing</p>
  13. Well you could use something like this, but it might be considered as a "overkill" var str = document.asform.author.value;for (i = 0; i < str.length; i++){ if (str.charCodeAt(i) != --- the values of the accepted chars ---) { alert("Please enter only letters"); document.asform.author.value=""; document.asform.author.focus(); return false; } else return true;} You'd probably write the script in a different way, but the above shows my idea
×
×
  • Create New...