Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Creating HREF with Java


Scott_Archer - 2:24 pm on Oct 12, 2012 (gmt 0)


I guess I am not explaining the problem very well, and I apologize for that. My challenge is that I am over my head a bit here so I am not be using the right terms.

I have managed to put together an order page where the math is being handled by Java.

Ultimately I end up with to sums at the bottom of the page. These two sums need to be transferred to my PayPal merchant account in a specific <a href> of their creation.


and it looks like this:

<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&amp;business=xxxxxxxxxxxx&amp;lc=US&amp;item_name=Auto%20Proxy%20Posting&amp;no_note=1&amp;no_shipping=2&amp;a1=COST-ONE%2e00&amp;p1=1&amp;t1=M&amp;src=1&amp;a3=COST-TWO%2e11&amp;p3=1&amp;t3=M&amp;currency_code=USD&amp;bn=PP%2dSubscriptionsBF%3abtn_subscrib">

So I need to break this up into five elements and reassembly it with COST-ONE & COST-TWO replaced in the string with my two java values - which are expressed as:

<input name="Text22" id="text22" type="text" value="$" readonly="readonly">

and

<input name="Text23" id="text23" type="text" value="$" readonly="readonly">


So you see I cant just have an anchor with a +n+ that tags onto the end.

If I use

var na = document.getElementById("text22").value;
document.getElementById('aa').getElementsByTagName('a')[0].href='paypal.html?name='+na;

I don't get the whole string I need.

I cant seem to find anything on line as an example of this type of assemblyman and so I am stuck. I am not a scriptwriter just a good mimic,and can't find examples to work from.

Can you help?


Thread source:: http://www.webmasterworld.com/javascript/4507120.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com