Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Thousand Separator or Pass a Variable in Source

Status
Not open for further replies.

MimUK

Vendor
Oct 12, 2005
7
0
0
GB
I have an update button in that passes to an external php based web page

The value passes but includes a thousand separator.

I would like this stripped or just pass Key7 (QueryString Value in Page) instead as this does not format the number as +(document.getElementById('_Dataoppo_opportunityid').innerHTML which displays as 35,123, i need 35123

eg.

<script language="javascript">
var newwindow;

function popwindow(url)

{

newwindow=window.open(url,'name','height=240,width=765');

if (window.focus) {newwindow.focus()}

}

</script>
<a href="javascript:popwindow(' External Site</a>

</SCRIPT>

Many thanks
 
I'm not sure if this is possible, but I have caption in the page with the value as well

<SPAN ID=_Captoppo_scenario class=TOPCAPTION>35123</SPAN>
 
In that case you have 2 choices:

1. Remove the commas by parsing out the string:

Code:
var NoCommaNumber = [green]document.getElementById('_Dataoppo_opportunityid').innerHTML[/green].replace(/\,/g,'');

or use the innerHTML of your other span that doesn't have a comma instead.

Code:
document.getElementById('[red]_Captoppo_scenario[/red]').innerHTML

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Thanks vacunita,
I used the _Captoppo_scenario span as I did not know where to put the var NoCommaNumber code

Cheers,

Mim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top