Jump to content

Patrick

Members
  • Posts

    18
  • Joined

  • Last visited

Posts posted by Patrick

  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. Code will be...<% if request.querystring("id_map") = "1" then response.write "<img src='images/spinstar.gif'>" %>
    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 %>
  4. i had used the following code in between stylebody{overflow:hidden}but if there is any overflow then i am unable to view the page so help me out
    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>

  5. 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>

  6. I have got this:
    <% counterNum = 0rsP.movenext While counterNum = counterNum + 1		wendend if %>

    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.

  7. I'm trying to change an onchange event, and I've got the code to do it and it's (almost) working, but I'm having a little problem with variables. Using this code:
    c2.onchange = function onchange(event) { replaceWord(inc1, (i - 1), r, (total - 1)) };

    Try this instead:
    c2.onchange = new Function(replaceWord(inc1, (i - 1), r, (total - 1)))

  8. I think <%=counterNum%> is not pulling any value. I think maybe there is a piece of code that is needed to link the <%=counterNum%> to the javascript code.What code should i put to get them to link-up, so the <%=counterNum%> gets a value?
    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?
  9. To make it even simpler.... try this.<p style="color:red;" onmouseover="java script:this.style.color='blue';" onmouseout="java script:this.style.color='red';" >Thanks for reading! </p>
    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>

  10. 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 :)

  11. If I had to solve that problem I would include a variable in every file before including the .js file. That string variable should be the path of the .js file relative to the current file, such as "../" if you're in a file in a subfolder. That string variable should be used in the .js file to make the link point to the correct file. I don't know if that could be a solution to your problem?

  12. Anything like this?

    <script language="javascript">var counter = -1;function moreFields(X){counter++;var newFields = document.getElementById('readroot' + X).cloneNode(true);newFields.id = '';newFields.style.display = 'block';var newField = newFields.childNodes;for (var i=0;i<newField.length;i++){var theName = newField[i].nameif (theName){newField[i].name = theName + '[' + counter + ']';if (theName == "texto[]"){newField[i].options[0].value = newField[i].options[0].innerHTML = "E-mail " + (counter + 1);newField[i].options[1].value = newField[i].options[1].innerHTML = "Link " + (counter + 1);}}}var insertHere = document.getElementById('writeroot' + X);insertHere.parentNode.insertBefore(newFields,insertHere);}</script><input type="button" value="+ E-mails" onClick="moreFields(2)"><div id="readroot2" style="display:none;" >        Texto: <select name='texto[]' class='field' onchange='email_text(this)'>    <option value='Email 1' selected='selected'>E-mail 1</option>    <option value='Link 1'>Link 1</option>    <option>Other</option></select>       E-mail/Link: <input name="email" type="text" id="email" value="" size="20" /></div><div id="writeroot2"></div>

  13. We can do this by using JavaScript Events that are triggereed by the "onmouseover" and "onmouseout" events :)This illustrates the point though it's useless as such:

    <html>	<body onload="document.getElementById('menu').style.display = 'none'">		<div align="left" style="color: #FFFFFF; background-color: #000099; text-align: center; width: 200px; padding: 3px;" onmouseover="getElementById('menu').style.display = 'block'" onmouseout="getElementById('menu').style.display = 'none'">Menu</div>		<div id="menu" align="left" style="color: #FFFFFF; background-color: #0000CC; text-align: left; width: 200px; padding: 3px;">Menuitem<br>Menuitem<br>Menuitem</div>	</body></html>

×
×
  • Create New...