How can I do this? Scripting Question...

Jupiter

New Member
Hey everyone. I'm new here, just registered a few minutes ago. Hope I find the day treating you all well!

I have a question regarding a script of some kind that I need to implement into a site I am designing.

I know this can be done easily, but I am not sure if I need to use PHP, Javascript or other. Here’s the scenario:

I have a client that wants to link her website to her corporate backend so she gets credit for any new sign-ups. She also has a team working under her and wants to be able to send her team to her site so they can also get credit for any signups. The link is this:

https://nettrax.myvoffice.com/maxintl/Application/Apply.cfm?EnrollerId=

Each person has a custom EnrollerID, example:

https://nettrax.myvoffice.com/maxintl/Application/Apply.cfm?EnrollerId=44471

What I want to do is create a small box where someone can type in any Enroller ID and hit “Sign up.” Then, the Enroller ID that they type in will be appended to the original link. So if someone types in 45236, the Sign Up button would link them to:

https://nettrax.myvoffice.com/maxintl/Application/Apply.cfm?EnrollerId=45236

Make sense? This way, anybody from her team that refers clients to the site can simply type in the 5 digit code given to them and the corresponding personal will get the credit.

Seems simple, but I don't have any idea on where to start right now. Any help is truly appreciated!
 

jnjc

New Member
Do you need to append it to the url ? Why not just submit a form it should have pretty much the same effect, something like this should equate to what you want:

Code:
<form action="https://nettrax.myvoffice.com/maxintl/Application/Apply.cfm">
	<input type="text" id="EnrollerId">
	<button type="submit">Enroll</button>
</form>

When the user submits then it should have the same effect as:
https://nettrax.myvoffice.com/maxintl/Application/Apply.cfm?EnrollerId=123345


If you really have to append it to the url then your best bet is to use JS, something along the lines of:

Code:
el = document.getElementById("FormName");
elId = document.getElementById("EnrollerId");
el.action = el.action + "?EnrollerId=" + elId.value;
el.submit();


HTH,
JC
 
Top