|
I want to understand how I can difference two request which were rised at the same time??
for example:User A want to buy some product and this product has price for example 5$, this User has only 10$ and increase price to 10$ but at the same time another User B increases price too, and his request postback faster than User A, because A has Slow internet...When A's request at last reaches to the server price is already changed and it's 10$ because of B and after that it will be 15$...
sorry for my English
C# Developer
|
|
|
|
|
I need to setup a web page so that a user cannot select text AND images. I am currently using
onselectstart="return false;"
in the body tag and that works fine for text, but images can still be selected.
This project is not a general purpose/public access website. I am building a kiosk-style system using HTML and Google Chrome as the browser. The system is designed to be interacted with via touch screen. Currently, if the user slightly moves their finger while touching an icon, the browser selects the icon and highlights it in blue. This isn't visually desirable. Is there a way to prevent this without modifying the Google chrome source code. I'm pretty sure I've seen sites that do something like this, but I can't find one right now and I'm just not sure what is the best method.
Thanks
|
|
|
|
|
Also use
ondragstart="return false"
It will solve your problem
|
|
|
|
|
Thanks. That worked perfectly.
|
|
|
|
|
Hi,
I am working with ADFS 2.0.I am creating a sample application on it.I have gathered information about it.
But may be my firewall is blocking it or some ports may not be enable for it.Can anyone tell me what ports need to be enabled for it.I am not sure this is right place to post this.ASAP
Thanks,
Maxy.
|
|
|
|
|
The cursor display with hand as default in the area that html tag defines.I want to change it with others. I tried to do it by using the "style" attribute,but it didn't works.
It is means that the "" doesn't support the cursor style?
|
|
|
|
|
No, the <area> tag doesn’t have a cursor style attribute
|
|
|
|
|
hiiiiiiii
any one can tell me from where i can download free Flash Slideshow Maker trial version for 30 days
Please answer me ASAP
rizvan sivally
|
|
|
|
|
Google[^]
Was not hard to find.
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
www.advance2000.net/upload/encode.php
if you look at that site i have a dynamic "table" that is filled out by the user, and i have the function in "onchange" that would change the subtotal values by multiplying the unit price and the quantity. here is the function of addrows of the dynamic table and the function for adding.
my problem is that the function only works for the first row and after that the value of the subtotal that is saved at the database is always 0. can someone help me through this?
function addRow(tbl,row){
row_no++;
if (row_no<=200){
if (row_no>=10){
var textbox = '';}
if (row_no<10){
var textbox = '';}
var textbox2 = '';
var textbox3 = '';
var textbox4 = '';
var textbox5 = '';
var tbl = document.getElementById(tbl);
var rowIndex = document.getElementById(row).value;
var newRow = tbl.insertRow(row_no);
var newCell = newRow.insertCell(0);
newCell.innerHTML = textbox;
var newCell = newRow.insertCell(1);
newCell.innerHTML = textbox2;
var newCell = newRow.insertCell(2);
newCell.innerHTML = textbox3;
var newCell = newRow.insertCell(3);
newCell.innerHTML = textbox4;
var newCell = newRow.insertCell(4);
newCell.innerHTML = textbox5;
}
if (row_no>200){
alert ("Too Many Items. Limit of 200");
}
}
function Sum() {
var q=document.getElementById("quantity[]").value
var x=document.getElementById("desc[]").value
var y=document.getElementById("itemno[]").value
var o=document.getElementById("ourcost[]").value
document.getElementById("ourcost[]").value=x*y
}
|
|
|
|
|
IDs in HTML should be unique, but every row you add has the same IDs in it, "quantity[]", "desc[]", "itemno[]" and "ourcost[]". The Sum function is only finding the first occurrence of each of the IDs and adding them up, though it would need to loop over all the rows in the table calculating the subtotal for each row.
Try using the row number as part of the ID, then you will be able to reference them individually using a for loop.
|
|
|
|
|
how exactly do i do that? i am new to JS and PHP so i don't know how to do it. can you at least show me how to do it? thanks.
|
|
|
|
|
OK, I'll use the first input as an example:
var textbox = '<input type="text" id="quantity' + row_no +
'" size="85" maxlength="10" name="quantity[]">';
- so your input will have IDs that end with the row number. Your Sum function can then loop over all the rows and updated the cost for each row:
function Sum()
{
for(var i = 1; i <= row_no; ++i)
{
var x = document.getElementById("desc" + i).value;
var y = document.getElementById("itemno" + i).value;
document.getElementById("ourcost" + i).value = x * y;
}
}
By the way, having the description field called "quantity" and the quantity field called "desc" is not helpful.
|
|
|
|
|
Thank you sir i got it to actually work, is it okay if i ask one last question? the values of the textbox "ourcost" is computer by multiplying x to y right? the outputs are correct but once i saved it in the database. it value that is saved is always 0. is there a way to get through this?
|
|
|
|
|
In your form you've got the input disabled - that means the value won't be passed through. Try "readonly" instead.
|
|
|
|
|
Thank you! you have been a great help to me... We finally got it to work. thanks again.. cheers! 
|
|
|
|
|
sorry to interrupt again, i have another question regarding the code... how can you add another textbox at the bottom that adds all the sub_total to produce the grand total? i tried this but it does not work.
function Grand()
{
for (var i=1;i<=row_no; ++i)
{
var x=document.getElementById("ourcost"+i).value;
document.getElementById("total").value += parseInt("ourcost"+i).value;
}
i placed this function on the textbox "subtotal" on a "on Change" method.
|
|
|
|
|
Just add the total into the existing Sum function:
function Sum()
{
var total = 0;
for(var i = 1; i <= row_no; ++i)
{
var x = document.getElementById("desc" + i).value;
var y = document.getElementById("itemno" + i).value;
var subtotal = x * y;
total += subtotal;
document.getElementById("ourcost" + i).value = subtotal;
}
document.getElementById("total").value = total;
}
|
|
|
|
|
I'm hoping someone can help. I'm very new to javascipt and am attempting to create a form that has hidden values to pass to Bing Search. I'm also trying to add a drop down menu that causes the value from the option the user changes to be passed along in the same url.
In short, if the user adds "java" in the text box and chooses "dallas" from the drop down menu it will incorporate these variables into the url along with the hidden words that are static, being "resume NOT jobs NOT apply". The url would end up looking something like: http://www.bing.com/search?&q=Resume+-jobs+-apply+java+"Dallas"
This is the code I have currently, that just fails
<script>
function converturl() {
document.go.url.value = document.go.url.value.replace(/\s/g, "");
var url = document.getElementsByName("url")[0];
var city = document.getElementsByName("city")[0];
var fullurl = document.getElementsByName("fullurl")[0];
fullurl.value = "http://www.bing.com/search?&q=Resume+-jobs+-apply+-submit+-required+-wanted+-template+-wizard+-free+-write+-sample+" + url.value.city
}
</script>
<form name= "go" onsubmit='converturl();location.href=fullurl.value.city;return false'>
<input name='url' type='text' /> <input name='fullurl' type='hidden' />
<select name="city"
OnSubmit='converturl();location.href=fullurl.value.city;return false'>
<option value="Dallas">Dallas
<option value="Chicago">Chicago
<option value="New York">New York
</select><input type='submit' value=" Go " />
</form>
<b>This script seems to work, but doesn't pass the city variable (url2) to bing.</b>
<script>
function converturl() {
document.go.url.value = document.go.url.value.replace(/\s/g, "");
var url = document.getElementsByName("url")[0];
var url2 = document.getElementsByName("url2")[0];
var fullurl = document.getElementsByName("fullurl")[0];
fullurl.value = "http://www.bing.com/search?&q=Resume+-jobs+-apply" + url.value
}
</script>
<form name= "go" önsubmit='converturl();location.href=fullurl.value;return false'>
<input name='url' type='text' /> <input name='fullurl' type='hidden' />
<input type='submit' value=" Go " />
</form>
<select name="city"
önSelect="location.href=url2.city.options[selectedIndex].value">
<option selected>Please Select...
<option value="Dallas">Dallas
<option value="Chicago">Chicago
<option value="New York">New York
</select>
modified on Tuesday, January 26, 2010 3:39 PM
|
|
|
|
|
<form action="" method="GET" onsubmit="location.href=converturl();return false">
<input name='url' type='text' />
<input name='fullurl' type='hidden' value='Resume+-jobs+-apply+'/>
<select name="city">
<option value="Dallas">Dallas
<option value="Chicago">Chicago
<option value="New York">New York
</select>
<input type='submit' value=" Go " />
</form>
<script>
function converturl(){
frm=document.forms[0];
return "http://www.bing.com/search/?q=" +
frm.fullurl.value +
frm.url.value + '+' +
frm.city[frm.city.selectedIndex].value
}
</script>
|
|
|
|
|
Thanks! That's exactly what I wanted to do. I appreciate it. 
|
|
|
|
|
|
I need to put together a web application that will pull wieghts from the scales that are connected to client computers with Serial ports. Is there any way to do this.
|
|
|
|
|
Hi,
I am in a similar situation. I have to read data from a weighing machine located on client machine and display the value in web page text box.I have tried lots of sample code but ended up with stack of errors.Could you please share your ideas/code with me? Its really urgent....
Thanks in Advance,
Manasa
|
|
|
|
|
Hi Iam facing the same problem,could you find away to do that issue ?plz help me
|
|
|
|