Creating a web form

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • Answered
I am setting up an app to send an embedded report to the customer for billing. At the bottom of the report I have a click to Approve or Declined. The click to Approve works fine. The click to Decline button is a redirect to a page where they can enter a reason for the Decline. My issue is pulling the rid from the original Decline link so that when the reason is entered and submitted, I update the existing record rather than creating a new record. I used the QB form generator which writes code to add and no option to edit a record. Since the rid is in the link of the button, I need to transfer that info.

Any help or suggestions would be greatly appreciated....I am not a coder but always looking to learn.
Photo of Joey Zint

Joey Zint

  • 1,508 Points 1k badge 2x thumb

Posted 5 months ago

  • 0
  • 1
To simplify I'd suggest sending your customer their record ID or Billing ID, whatever number corresponds to the actual Quick Base record #. Make this prominent in the email they get.

Then on your Decline web form ask for this ID as part of their submission.

You can then update the code on your page to use API_EditRecord action in place of the API_AddRecord and include an input field for the record ID. Defining the input as follows:

<input type="text" id="key" name="key" />

Here is a very rudimentary example where you'll just need to substitute your values:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>     

<body>

<form name=qdbform method=POST onsubmit='return validateForm(this)' encType='multipart/form-data' action=https://yourcompany.quickbase.com/db/yourtableid?act=API_EditRecord&apptoken=xxxxxxxxxx>;
<input type=hidden name=fform value=1>

<div class="sub-heading">Thank you for responding to the email</div><br>
<div><textarea name=_fid_18 rows=6 placeholder="Why are you declining this bill?"></textarea></div>
<br>
<label>If you would like us to follow up, please check this box
  <input type="checkbox" name=_fid_26 value="1">
</label>
<br>
<br>
<div><input type="text" rid="key" name="key" placeholder=" Billing ID" /></td></div>
<br>

<input type=hidden name=rdr value='https://yourcompany.quickbase.com/db/yourdbid?a=dbpage&pageID=X'>;
<input class="button" type=submit value=Submit>
</div>
</form>

</body>
</html>
Photo of Micro Dev

Micro Dev

  • 834 Points 500 badge 2x thumb
You post helped me debug my HTML page.

Thanks.

For some reason the rdr does not redirect to a webpage I am directing it to. Instead it only goes to quickbase pages. 

Any workaround?

Thanks
Sadly that is the case. I think I even opened a ticket with QB support to ask what I was doing wrong.

The workaround I used (and what they suggested) was to redirect to another quickbase code page and put a button on that page that will send them to where you want them to go.

For my web form I have a "Thank You" page with a "please click here" button that takes the user to an opt-in form. It's not a very elegant solution, but it works.

You can check it out here if you like: https://www.quickbasejunkie.com/p/courses-learn-more

Here's the code too:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base target="_parent">
<style>
.button {
  width: 50%;
  font-size: 18px;
  line-height: 1.6;
  margin: 0 auto;
  text-decoration: none;
  text-align: center;
  padding: 0.9rem 1.1rem;
  border-radius: 2px;
  border: 2px solid #FFA6B6;
  background-color: white;
  color: #FFA6B6;
  font-family: Arial;
  font-weight: 300;
}
.sub-heading{
  font-size: 20px;
  font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  color: white;
  text-align: center;
  line-height: 1.6;
}
</style>
</head>    
<body>
<p></p>
<p></p>
<p></p>
<div class="sub-heading">Thank You!</div><br>
<a href="https://www.quickbasejunkie.com/p/input-thank-you"; style="margin:auto; text-align:center; display:block;" class="button">Please Click Here</a>

</body>
</html>