6 years ago
1
Topic

I am trying to auto-fill a text or dynamic element with the article id from a button. I believe I am sending the article id correctly using:

caseid = $cck->getValue('art_id')

I can see the article ID in the url when the button directs me to the new form window. I'd like to fill a text box, if possible, or a dynamic element with the article ID (caseid) that I extracted from the previous table. I can't seem to figure out how to do this with a text box, and if I try to do it dynamically I get an SQL error. It seems as if the caseid is not being set to anything, because the error shows that it is blank.

SQL=SELECT id,id FROM #_content WHERE id = ""

I am using the following SQL command to get the id of the original article I want to link to:

SELECT id,id FROM #_content WHERE id = "$uri->getValue('caseid')"

I'm not sure what I'm doing wrong. The ideal solution to the problem would just to have the caseid populate a text box, but if that's not possible I'll need to use the dynamic element.

Get a VIP membership
4229 Posts
Kadministrator
6 years ago
0
Level 1

If you have a variable in URL you can use SQL live value plugin from SQL pack to get the value https://www.seblod.com/resources/extensions/plug-ins/sql-pack

Please note your query makes no sense, you are selecting id from a table based on value you already have, also your id is specified twice. If you just need to get this value from url to a text field you can use URL variable live value, this one is a part of the core.

Get a VIP membership