Forum Moderators: open

Message Too Old, No Replies

need to add my url after .value inside script / form

a little help

         

steelwidow

5:36 pm on Mar 5, 2009 (gmt 0)

10+ Year Member



I need a little help getting this script to append a url after their affiliate id. I'm doing this all inside a form. A person puts in their affiliate id, clicks "get code" and its automatically put inside a url so they can copy and paste it on their own.

I have it all working but I need to add an additional url after their affiliate id is inserted...

What I'm getting on my results is:

http://example.com/cgi-bin/clicks.cgi?CA=999999-0000&PA=666666

What I need is:

http://example.com/cgi-bin/clicks.cgi?CA=999999-0000&PA=666666&HTML=http://www.example.com/promo/mypage.html

So here's the problem area of the code:

<a href="javascript:void(null)" onClick=" document.form2.linkg58url.value='http://example.com/cgi-bin/clicks.cgi?CA=999999-0000&PA=' +document.getElementById('affiliateid').value">Get Code</a>

I can't figure out where to put the rest of my url:

&HTML=http://www.example.com/promo/mypage.html

Inside here: .value

Or rather what to append after .value to add the rest of the needed url...?

Hope this makes sense. I'm sure it's something really dumb but for the life of this obvious newby I can't figure it out.

Thanks!

~~ SteelWidow ~~

[edited by: Fotiman at 6:59 pm (utc) on Mar. 5, 2009]
[edit reason] Examplified URLs [/edit]

daveVk

10:31 pm on Mar 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<a href="javascript:void(null)" onClick=" document.form2.linkg58url.value='http://example.com/cgi-bin/clicks.cgi?CA=999999-0000&PA=' +document.getElementById('affiliateid').value
+ '&HTML=http://www.example.com/promo/mypage.html';return false;
">Get Code</a>

steelwidow

5:06 am on Mar 6, 2009 (gmt 0)

10+ Year Member



Thank you soooooooooooooooo much! I had spent hours trying to figure it out. You are awesome! It worked. :-D

steelwidow

5:58 am on Mar 6, 2009 (gmt 0)

10+ Year Member



Quick question. Right now I have the <a href-"java etc. inside an input field and the code that gets spit out, as you can see, is too long to be inside a one-liner.

Is there anyway to put this so that it comes up in a bigger field like a text area?

daveVk

6:25 am on Mar 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Changing input type="text" to textarea should not be a problem. Add any other attributes that may be on the current input tag.

<textarea name="linkg58url" id="linkg58url"></textarea>