Page 1 of 1
Prices in table
Posted: Thu Feb 13, 2025 6:55 am
by Joan Ferrer
Hello
In a project, I want to put prices in a table (for example)
Each price in a box, in the table, put it in different places in the project. Is this possible, any examples?
Thanks.
Re: Prices in table
Posted: Thu Feb 13, 2025 7:18 am
by Pablo
Re: Prices in table
Posted: Thu Feb 13, 2025 7:34 am
by Joan Ferrer
Is it possible to use table prices in different text fields, in different parts of the project?
That is, in a text box, take the value from another place.
Tnk's
Re: Prices in table
Posted: Thu Feb 13, 2025 10:11 am
by Pablo
No, that is not possible with standard HTML tools. This requires scripting.
Re: Prices in table
Posted: Thu Feb 13, 2025 10:31 am
by Joan Ferrer
ok, tnk's
Re: Prices in table
Posted: Thu Feb 13, 2025 11:56 am
by BaconFries
As Pablos reply it would require scripting! (custom). I used the following in bold in Copiolet AI
How do I pass the HTML table value to another HTML page’s text box display?
and it returned the following:
Source: Page with Table
Code: Select all
<table id="data-table">
<tr>
<td id="cell-value">Sample Value</td>
</tr>
</table>
<button onclick="passValue()">Pass Value</button>
<script>
function passValue() {
// Get the value from the table cell
const value = document.getElementById('cell-value').innerText;
// Redirect to the destination page with the value as a query parameter
window.location.href = 'destination.html?value=' + encodeURIComponent(value);
}
</script>
Destination Page:
Code: Select all
<input type="text" id="textbox" />
<script>
function getQueryParameter(name) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(name);
}
// Get the value from the query parameter
const value = getQueryParameter('value');
// Set the value in the text box
document.getElementById('textbox').value = value;
</script>
Note all of the above is for reference example
only the code in WWB will be different. It only contains the code for the table, the javascript and input (text box) all other page html is removed. You could use the query above in any AI you use and see the results you could then implement.
Re: Prices in table
Posted: Tue Feb 18, 2025 1:17 pm
by Joan Ferrer
oh thanks, I check and comment, thanks