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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie help with very basic Javascript

Status
Not open for further replies.

C4rtm4N

MIS
Sep 29, 2004
54
GB
Hi

I'm trying to create a website that's hosted with a free provider that doesn't allow PHP, CGI or ASPX pages, leaving only javascript as an option. This really is not my thing so I'm after a bit of help.

I need to update a number of links on the page, appending a sales id to them that will be input by the user on the following form. Alternatively a 2nd page could be loaded with the links on if this is easier (it's how I would have done it if I was able to use .Net)

<form method="post">
<p><b>Step 2:</b> Enter your tracking id here: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="sid" size=10>
<br><br>
<b>Step 3:</b> Click&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" value=" Update Links " onClick="validate()">
</p>
</form>

Would anyone be able to give me a bit of help?

Thanks

Steve

____________________________________________________________

____________________________________________________________
 
Without some kind of server-side script to save the sales id somewhere, only the user who entered the sales id would be able to see the updated links. There are plenty of free hosts that support the kind of scripts you mentioned though.

Adam
 
Thanks Adam
I'm not bothered about the user seeing the sales id - it'll be their own number anyway. I'd prefer to keep the website with the current provider if I can, hence the question.

Can anyone help with the script or at a real push let me know of a free provider that offers a Windows box supporting aspx (I have only ever seen cgi & a few php supporters)?

Thanks

Steve
____________________________________________________________

____________________________________________________________
 
What adam0101 was saying is that javascript has no access to any file system and thus is not useful for storing information - you need a server side script (php/coldfusion) if YOU ever want to see what the customer enters.

The only possible way I can think of doing something like this with javascript alone is if you used javascript to email the information to you after the customer filled out the form.

Obviously though this will not be secure and you are bound to be innodated with false orders when someone with nothing better to do finds out your order system.
 
Sorry, I should have made myself more clear (& read Adam's reply properly).

The site in question is to do with affiliate marketing so I don't need to see what the user entered as it's captured server side by the advertiser and reported to me by them. An example of what I need to be able to do is as follows -

The following link would be present when the page was loaded, clicking on it would work & assign a sale to the dummy id of QQQ, if it's possible the javascript would amend the QQQ to whatever the user had input into the form at the top of the thread (eg 123).

<a href=" target="_top">

Thanks

Steve
 
HTML...
Code:
<a href="javascript:addID();">text of link</a>
SID:<input type="text" id="inputID" />
JAVASCRIPT.....
Code:
function addID(){

if(document.getElementById('inputID').value != ""){
var myURL = "[URL unfurl="true"]http://www.kqzyfj.com/click-2141463-10418740?sid="[/URL] + document.getElementById('inputID').value; 

document.location.href = myURL;

}
else{alert("Please enter SID code");}
}

something like this perhaps?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top