This topic is locked

Storing value in a textbox (that's not associated with a field in the database)

5/12/2021 5:44:54 PM
PHPRunner General questions
J
JoeB7774 author

If I create a textbox on a form, is there a way to pass a value to it if it's not associated to a field in the database? I don't really need to store the value that is passed to it ... I just need the user to see it (which is why I thought an unassociated text box). I would likely be putting this in an 'after add' event of a different control.

admin 5/12/2021

If you just need to show something to the user, maybe you can use a simple code snippet to display that value?

HJB 5/15/2021

https://xlinesoft.com/phprunner/docs/sweetalert-popups.htm

"Sweet Alert" functionality had been recently added to PHPRunner and so,
just to display a (non storable) value in a popup window shoudl be easy.

https://stackoverflow.com/questions/50956435/how-can-i-do-get-value-in-sweet-alert-poppup-message-content

Above link content for inspiration purposes only, maybe, the admin can contribute by more hints in this case.

J
JoeB7774 author 5/16/2021

Is there a way to get the code snippet to update when something happens. For example, if a record is added on a sub form.

admin 5/16/2021

Yes, you can use jQuery for this purpose.

For instance, your code snippet outputs something like this:
<span id="mytext">Some text</span>

Now in some Javascript event you can use a code like this:
$("span.mytext").html("Some new text");