This topic is locked

Changing the value of a field (inline edit)

4/29/2009 8:30:21 AM
PHPRunner General questions
J
jdu001 author

Hello,
I have a listpage with inline edit/add functionality with 2 fields (SelectName and SaveName).

SelectName is a dropdown box with the all the names form the database.

SaveName is a required textfield which has to be saved in the database (it can contain names not belonging to the database).
You can type directly a name in the SaveName field or you select a name with SelectName.

I want to copy the content of SelectName automatically to SaveName if SelectName is filled.
How can I realize this or is there another option ?
Greetings,
Jo van Duin

J
Jane 4/30/2009

Hi,
use custom JavaScript code for this purpose. You can add JavaScript code at the end of the page in HTML mode on the Visual Editortab.

Here is just a sample:

<script>

document.forms.editform.value_SelectName.onchange=function()

{

document.forms.editform.value_SaveName.value = document.forms.editform.value_SelectName.value;

}

</script>

L
laonian 5/1/2009

use custom JavaScript code for this purpose. You can add JavaScript code at the end of the page in HTML mode on the Visual Editortab.

Here is just a sample:


Jane and Jo van Duin,
I wonder whether the script works on the list page in inline add/inline edit mode. I guess it works only on Add or Edit page. Please comment. Thanks.

J
Jane 5/4/2009

Hi,
this script works for simple add/edit pages.

J
jdu001 author 5/6/2009

Hi,
I use an inline add/edit construction. How must I use the JavaScript in this case?
Jo

J
Jane 5/6/2009

Hi,
unfortunately there is no easy way to upate values on the fly for inline add/edit pages.