Error with API_AddRecord

  • 0
  • 2
  • Question
  • Updated 3 years ago
  • Answered

I have a simple 5 field record I am testing this on before I make my large form from websites. For some reason when I add a new record I get no error but none of the fields carry over to the new record.


<removed>
<input type=hidden name=fform value=1>
<table>
<tr><td class=m>Apples</td>
<td class=m><input type=text size=10 name=_fid_6 ></td></tr>
<tr><td class=m>Oranges</td>
<td class=m><input type=text size=10 name=_fid_7 ></td></tr>
<tr><td class=m>Peaches</td>
<td class=m><input type=text size=10 name=_fid_8 ></td></tr>
<tr><td class=m>Bananas</td>
<td class=m><input type=text size=10 name=_fid_9 ></td></tr>
<tr><td class=m>Pears</td>
<td class=m><input type=text size=10 name=_fid_15 ></td></tr>
</table><input type=hidden name=rdr value='http://'&gt;
<input type=submit value=Save>
</form>

Powered by QuickBase Online">http://quickbase.intuit.com/">Online Database

<script lang="javascript">
function CheckForOther (item, origlen)
{
var sitem = item.options[item.selectedIndex];

if (item.selectedIndex == (item.length - 1))
{
var val = prompt ("ADD A NEW CHOICE:", "");

if (val == null)
item.selectedIndex = 0;
else
{
var slen = item.length;

if (slen == origlen+1){
item.options[slen] = new Option (sitem.text, sitem.value);
                        }
item.options[item.length-2].text = val;
item.options[item.length-2].value = val;
item.selectedIndex = item.length-2;
}
}
}
</script>
<script lang=javascript>
function validateForm(theForm)
{
}
</script>

and I get back this as the responce


<qdbapi> <action>API_AddRecord</action> <errcode>0</errcode> <errtext>No error</errtext> <rid>7</rid> <update_id>1468424567001</update_id> </qdbapi>
 but it shows nothing

Photo of Robert

Robert

  • 30 Points

Posted 3 years ago

  • 0
  • 2
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
First, I would censor your QuickBase URL that you provided.  Since your permissions are not setup properly, any user can hop on and mess around in your "Test Playground".

(I'm interested in your "Count my fruit" table & the "forcedgraph" field.  How'd you do that!)

Second, the No Error response is a good one, that means that SOMETHING was uploaded.  Although from the URL it doesn't seem like you're punching in any data into any fields.. Just creating a blank record?
Photo of Robert

Robert

  • 30 Points
Well yes I have even tried to use the API_AddRecord with specific field inputs but they still wont post.

as for how the graph works see
https://jsfiddle.net/rpratt009/qdtuptes/2/
for the working version and this
https://jsfiddle.net/rpratt009/wonLe843/5/
for the literal field input. be warned it has a lot of un needed fluff I have not yet trimmed
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
Thanks for the input on how the graph works!  Very interesting, something I could use on a form page.  Thanks for that.

As far as input goes, here's a brief little excerpt of a "Contact Us" form that I modified and used on my website.  Should be the same concept.  Here's the pastie:

HTML: http://pastebin.com/LyEjPsAv
PHP: http://pastebin.com/JK4htsaC

I just googled a basic php email script, I'm sure there are javascript ones if you must have it in javascript.   Let me know if you need any additional help.

Thanks again for the graph stuff.

Scott
Photo of Robert

Robert

  • 30 Points
I see. you converted the input fields to a javascript and then make an API add record with the variables. I will give it a shot when I have time this weekend
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
Yup yup!  Hope it helps.  Should work smoothly.  You'll have to do something with a page redirect once you submit information b/c the XML "NO ERROR" screen will show.  So if you are having a customer or someone enter information, you likely don't want them to see this.
Photo of Robert

Robert

  • 30 Points
Yes I plan on having a redirect once its finished. Also I did not realize we had basic sharing app access on that system thank you for pointing that out. We are running a scan to see if any other users access the information.
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
No worries!  I watch over user role permissions like a hawk in my apps.  It's very easy to forget to update a new tables permissions or forget to set them at all.  BUT it's extremely important to maintain a secure environment.  Good luck to you Robert, if you need any help in the future feel free to let me know.  My contact info is on my profile.
Photo of Nathan

Nathan

  • 60 Points
Thank you Scott for pointing this out, we have a new person testing things and they let the permissions go to far on testing. I have informed them of their error, but thanks again, data breaches are no fun.