How to use the same form to view, edit and create?

Can I use the same elements to display things, then to edit and create new things?

Can I use input boxes for everything; display, edit, and …input?
Can I use input boxes to display things?
What direction should I follow?

1 Like

It’s possible, sure, but might not be the best UX. Users typically expect an input field to be for inputting data, so if I see one that I can’t mess with, it feels like something is broken. You can use the same form for creation and editing, though. I tend to do that for my apps using custom states.

1 Like

Usually, I would use a text box to display something.

But, could I use an input box to do that, to display?
So afterwards, I could use the same inbox to create or edit …

Is it poosivel to do with custom states?

I use a form to create new entries and the same form for users to edit existing data. I set a custom state when opening for editing and use the conditional options for the input boxes to determine when pull in existing data for the edits, based on the custom state. It works pretty well.

3 Likes

Another way to do it is to use Autobinding. That will save user edits as you go along.

1 Like

I’m trying, but I can not get there.

In this app, I have a form - https://bubble.io/page?type=page&name=form_to_create_search_edit&id=labcarlos&tab=tabs-1

To get started, I want to create a view / search mode.

  1. I want the input box “name” to be disabled.
  2. Then, I want the box to be enabled when the “New” button is clicked.

I have worked hard, but I can not get there.

Flow could be:
The button state at the beginning should be “no” = the box would be disabled "
When clicking the “New” button, the status should be “yes” = the box would be enabled ".

But how?
Or is there another way?..

1 Like

I have updated the page so the “new” button set’s the IsDisabled state to “no”.

Also, have prepopulated the input with the selected Contact, if present.

1 Like

Thank you @NigelG. Great work.

This is the first time I’m working with custom events.
Meanwhile, I realized that I was confusing, custom events with custom states.
I walked in circles until I realized they are different things.

I should have started by in workflow:

Custom > Create a custom event, and then create thecustom state …


But now I want to clear the contents of the input boxes and I can not.
The idea is when the button “New” is clicked, clear all input boxes, and focus on the first one.

I have grouped the input boxes, but does not work with “Reset inputs” or “Reset data”.

OK, so you need to be able to reset the group that the inputs are in, to clear them.

To do that we need to remove the initial setting of the group, and replace it with it being set when the search box’s value is changed.

Then, when you click “new” it resets the group.

1 Like

Now is working, with @NigelG help!

The form:

  • Search - (done) - search the name in the database: “Carlos”
  • Create - (in progress)
    *->Workflow: When page is loaded > Set state “InputDisabled” = “yes”
    *->Input xx : Conditional, is “Yes” = Input disabled.
    *->Buttont New: Workflow > Reset Group SeachBox > Set State “InputDisabled” = “no” > Reset Group Detail > Set Focus Input Name

To set focus on the first input box it is necessary to click twice the button “new”!!!
This only happens at the beginning when the page is loaded for the first time!

How to set up to focus the input box also when the page is loaded for the first time?

Now, is necessary to click twice!

Hmmm, that’s a bit odd. Looks like a bug.

You can fix it by adding a very short pause between the two actions.

Has anyone done this using the SQL Connector as the database with the data to edit? I cannot get the default value in the conditional to load the existing record (from the parent RG) to load when using a dropdown field. Open for any ideas.

Thats work, with only 5 ms.

Thanks, very much.

Can you raise a bug ?

1 Like

Bug reported.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.