Jump to content

[SOLVED] DIV tag value issue


ainoy31

Recommended Posts

I am trying to get the value from a <div> tag.  Here is my JS code:

 

function checkRefund()
{
var price=document.getElementById("price").value;
var ref=document.query_simple.refund.value;
document.write(price);

if(refund > price)
{
	alert("The refund amount can not be greater than the current price amount");
	return false;
}
return true;
}

 

Here is the rest of the code:

<td class="LT">Price</td><td class="LT"><div class="fld narrow" id="price"><?php printf("%.2f", $record->fields['price']) ?></div></td>
<td class="LT">Refund</td><td class="LT" colspan="5"><input type="text" name="refund"
value="<?php printf("%.2f", $record->fields['refund']) ?>" onblur="checkRefund();"></input></td></tr>

 

This prints out undefined for the price value.  Much appreciation AM

Link to comment
https://forums.phpfreaks.com/topic/156420-solved-div-tag-value-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.