hoek Posted September 17, 2003 Posted September 17, 2003 I am sure the answer is obvious, but I just have no clue at this point. I have made a link.. <p><A href="http://65.69.30.194/downloads/[FMP-Field:Img1_downloadlink]"><strong>Begin Download</strong></A></p> I would like to add a script... <p><A href="http://65.69.30.194/downloads/[FMP-Field:Img1_downloadlink]&-script=Img1_downloadcounter"><strong>Begin Download</strong></A></p> Why isn't this working for me? What can I do to solve this problem? I should also note that this link is inside of an existing form, but I need the sript to run when clicking the link, not when submitting the form. And all the script is doing is increasing the value of a field by +1.
Unable Posted September 17, 2003 Posted September 17, 2003 If you are not talented enough to figure that out, then you are not talented enough to run a ScriptMaker script safely over the web. Do yourself a favor and use a calculation.
Steve T. Posted September 17, 2003 Posted September 17, 2003 Hi, hoek! Hmm.. most CDML links I have made all end in ACTION commands but I see your first one does not since it is just substituting field information for a path from some previous FIND or something you must already have in your website. When you want your link TO DO something, I think you need to use one of the ACTION tags (-new, -find, -edit, etc.). In your case, you may want to use a -findany if you don't really need it to do anything but the script. Read more about CDML links, though. When you use an action you'll need to include things like -db, -lay, etc. in the link, too. Hope this helps! --ST
Steve T. Posted September 17, 2003 Posted September 17, 2003 Oh, by the way... Unable is correct about scripts over the web. Usually, you want to avoid them unless your solution will not have a problem with multiple users executing the script at the same time. For example, I am going to try to use a script that needs to execute at some point that is not specific to the user executing it... just house-cleaning script. I have not tested it yet, but don't anticipate any problems (like we ever do, eh? lol!). --ST
Anatoli Posted September 17, 2003 Posted September 17, 2003 You didn't specify any valid FM WC action like -FindAll or -Edit.
hoek Posted September 19, 2003 Author Posted September 19, 2003 I am not here for the abuse. I came here for help. Obviously I am not talented enough. If I was talented enough, I wouldn't have posted the question. Weren't you a novice once? OK. That felt good. I want to design a link that will initiate a download of a file, then change a field value by +1. So somehow I need to add the fact that I want to -edit. Thanks for the help with that Anatoli. And i now understand that i need to point to a database, layout, and format. <p><A href="http://65.69.30.194/downloads/[FMP-Field:Img1_downloadlink]"><strong>Begin Download</strong></A></p> coluld someone modify this line to give me some direction?
Garry Claridge Posted September 19, 2003 Posted September 19, 2003 This one works for me: <script> function addone() { document.myform.amount.value = (document.myform.amount.value - 0) + 1 ; document.myform.submit(); } </script> </head> <body> <form name="myform" method="POST" action="FMPro"> <input type="hidden" name="-db" value="combotest.fp5"> <input type="hidden" name="-lay" value="web"> <input type="hidden" name="-format" value="hworldimage.html"> <input type="hidden" name="-recid" value="[FMP-CurrentRecID]"> <input type="hidden" name="amount" value="[FMP-Field:amount]"> <input type="hidden" name="-edit"> </form> [FMP-Field:amount]<br><a href="[FMP-Field:Img1_downloadlink]" onclick="javascript:addone();">Begin Download</a> </body> OR, try this: </head> <body> <form name="myform" method="POST" action="FMPro"> <input type="hidden" name="-db" value="combotest.fp5"> <input type="hidden" name="-lay" value="web"> <input type="hidden" name="-format" value="hworldimage.html"> <input type="hidden" name="-recid" value="[FMP-CurrentRecID]"> <input type="hidden" name="-script" value="Img_downloadcounter"> <input type="hidden" name="-edit"> </form> [FMP-Field:amount]<br><a href="[FMP-Field:Img1_downloadlink]" onclick="document.myform.submit();">Begin Download</a> </body> All the best. Garry
Unable Posted September 19, 2003 Posted September 19, 2003 Don't be a whiner. OK. That felt good. Cheese and crackers, don't be so damned sensitive. I gave you very good advice, "Do yourself a favor and use a calculation." Pay attention. Think! You can find such an incrementing calc and other ideas here. Or you can use the JS suggested by Garry.
Recommended Posts
This topic is 7728 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now