Jump to content
  • 0

Change Received Parameter In Submission Form


bookish

Question

Hello! My question this time is about received parameters. I have a results page from where I pass parameters to a submission form. One parameter @AMOUNT needs to be changed to AMOUNT1 if ACTIVITY 1 and AMOUNT2 for ACTIVITY2 for any one who signs up and her authentication field country is neither COUNTRY1 nor COUNTRY2. Hope I can get some help. Thanks!

 

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
Hi bookish,
 
You can add HTML block on the Result page and use following code: 
<SCRIPT LANGUAGE="JavaScript">
var test='<a href="URL&amount=';
var countr = '[@field:country]';

if ((countr !="country1")&&(countr !="country2"))
{
 if('[@field:activity]'=="activity1") {test=test+'[@field:amount1]';}
 else 
 {
  if('[@field:activity]'=="activity2") {test=test+'[@field:amount2]';}
  else {test=test+'[@field:amount]';}
 }
}
else 
{
 test=test+'[@field:amount]';
};
test=test+'">the link</a>';
document.write(test);
</SCRIPT>

Please change URL to your.

 

Hope it helps.

Link to comment
Share on other sites

  • 0

Hi Caspio Ninja, that's a brilliant idea. I never thought I should change the amount from the Results Page. I am pretty sure it will work except that at the moment I have a current HTML block in the results page. I am at a lost how I could insert your additional conditions. Your code must be activated when both Signup Here and Waitlist Me are possible.

Link to comment
Share on other sites

  • 0

By the way, Caspio Ninja, here is my existing code:

 

<script>

 

if ([@field:amount] == "0")

{

document.write("No Signup Yet");

}

else if([@field:attendees] < [@field:max_attendees])

{

document.write("<a href='URL?ID=[@authfield:ID]&activity=[@field:activity]&amount=[@field:amount]'>Signup Here</a>");

}

else if ([@field:waitlisted] < [@field:max_waitlist])

{

document.write("Closed. <a href='URL?ID=[@authfield:ID]&activity=[@field:activity]&amount=[@field:amount]''>Waitlist me</a>");

}

else

{

document.write("<div>Signup & Waitlist Closed</div>")

}

</script>

Link to comment
Share on other sites

  • 0

Hi Bookish,

 

I am not sure that understand correctly both scripts, but i have tried to concatenate them:

<script>
if ([@field:amount] == "0")
   {
      document.write("No Signup Yet");
    }
else if([@field:attendees] < [@field:max_attendees])
   {
      document.write("<a href='URL?ID=[@authfield:ID]&activity=[@field:activity]&amount=[@field:amount]'>Signup Here</a>");
    }
else if ([@field:waitlisted] < [@field:max_waitlist])
   {
      var test='Closed. <a href="URL?ID=[@authfield:ID]&activity=[@field:activity]&amount=';
      var countr = '[@field:country]';
      if ((countr !="country1")&&(countr !="country2"))
         {
            if('[@field:activity]'=="activity1")
               {
                  test=test+'[@field:amount1]';
               }
            else
               {
                  if('[@field:activity]'=="activity2")
                     {
                        test=test+'[@field:amount2]';
                     }
                  else
                     {
                        test=test+'[@field:amount]';
                     }
                }
         }
      else
         {
            test=test+'[@field:amount]';
         }
      test=test+'">Waitlist me</a>';
      document.write(test);
   }
else
   {
      document.write("<div>Signup & Waitlist Closed</div>")
   }
</script>

I hope, it works - and works correctly.

Link to comment
Share on other sites

  • 0

Yes!! Thanks a million, Jan.

It finally worked with a few edits. I share it below:

      var test='Closed. <a href="URL?ID=[@authfield:ID]&activity=[@field:activity]&amount=';
      var countr = '[@field:country]';

      var acttype = '[@field:activity_type]';
      var amount1 = 9999;
      var amount2 = 99999;
      if ((countr !="country1")&&(countr !="country2"))
       {
           if (acttype=="TYPENAME1") {test=test+amount1;}
             else {test=test+amount2;}
       }
       else {test=test+'[@field:amount]';
       };
      test=test+'">Waitlist me</a>';
      document.write(test);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...