baseportal
Start

baseportal message board

Welcome to the baseportal message board...

Please read the FAQ.

 
 Selected message: To the list 
    Message from merryn on 9/10 2003, 23:03 +10:00
    EMail: merrynhome@bigpond.com

    adding a modify link to update an db item from the web page


      I have read and re-read and re-read again all your documentation, scrolled through your message board and read several introductions to perl documents.... BUT I can't find an answer or solution to my probem. What I can't work out is how to create a link (just like your Modify and Delete links on the baseportal Database Content page) from my own baseportal webpage in order to show than an item has been "reserved" or taken.
      The database is really simple - only two fields: "item" [a text field with the product name] and "availability" [a numerical field with the values 0=available and 1=taken].

      I want to create either a button or a hyperlink (like your Modify | Delete options) to do this.
      When I try using a form and a button I use the command:

      <perl>
      mod "item==!X", ["availability", "1"], "MyDB";
      </perl>
      which works but it changes the availability of ALL items to be "taken" (ie. from "0" to "1").

      I also want to confirm (like your delete option does) if the user really wants to modify the item.

      So what I need to do is, IF the user confirms that they do really want to take the item, THEN do the ...

      mod "item==!X", ["availability", "1"], "MyDB";
      but I can't work out how to ONLY run the perl script only IF they confirm the modify/submit. (Can you return a value from a form button to a perl script??)

      As an alternative I looked at your code to try and understand how you did the Modify | Delete but I can't work out how to use the right perl commands in my own anchor tag.

      Am trying something like...

      <perl>
      out <a href="/baseportal/MyDB/main&cmd=do_mod&item=X&availability=~s/0/0/" onclick="return confirm (\'Are you sure you want to take this item\')">Modify</a>';
      </perl>
      but am now getting error messages....

      Am a bit of a pearl and baseportal novice but was pretty impressed with how well I was doing up to now. This is all I have to do to get it working!!

      I've tried everything I can think of and can't find any other examples like what I want to do.

      Any help would be GREATLY appreciated...
      Thanks

    Your reply:

    Name: EMail: WWW:
    Subject:
    Text:
    Timezone:

    Post a new message 

 Messages from 3300 to 3450: To the input form 
<< Newest messages | < Newer messages | To the input form | Older messages > | Oldest messages >>


Back to the homepage

© baseportal.com. All rights reserved. Terms of use



baseportal.com