Dynamic Page SUBMIT BUTTON LINK

I have FINALLY successfully implemented the Login/My Profile member page but I have three issues:

  1. In the database connection menu I want to change the Stay On This Page to my site’s HOME page. The only choice is a Link, but clicking on lick adds a link to the submit button which Breaks this?

  2. If I use the Tab key when filling out the form, it randomly jumps to different input boxes, even though the boxes are named input#1, input#2 etc…

Hi, See answers here .

Liran.

Based on a reply, I added the following to page code
wixLocation.to(“/home”);
And as usual, it BROKE THE PAGE, even after taking this out. The Submit button now no longer updates my database. Is wix code really this flakey? If I had been doing this with C-language I would have been done three weeks ago!

The video on YouTube done by Nayeli, shows her doing it without any wix code. But when I click on link from within the submit button, I do not get a Choose menu.???

Hi,

In order for us to further investigate - please save your editor while it is in its broken state and reply back.

After refreshing cache, it appears to be working again. But I still have not figured out how she did it. Look at her video at around time code: 32:15. When she changes Stay on Page to A Link, she gets a CHOOSE menu. I am not getting that, WHY?

oops, just tried it again and it is broken. Adding last name in form and clicking submit. Nothing happens. I should get the Successful Message.? It worked yesterday?

HI, in order for us to help with that specific issue, please share your part of code or the URL for your site.

Liran.

import wixUsers from ‘wix-users’;
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;

$w.onReady( () => {
if(wixUsers.currentUser.loggedIn) {
$w(“#button2”).label = “Logout”;
$w(“#button3”).show();
}
else {
$w(“#button2”).label = “Login”;
$w(“#button3”).hide();
}
} );

export function button2_click() {
// user is logged in
if(wixUsers.currentUser.loggedIn) {
// log the user out
wixUsers.logout()
.then( () => {
// update buttons accordingly
$w(“#button2”).label = “Login”;
$w(“#button3”).hide();
} );
}
// user is logged out
else {
let userId;
let userEmail;

// prompt the user to log in  
wixUsers.promptLogin( {"mode": "login"} ) 
  .then( (user) => { 
    userId = user.id; 
    return user.getEmail(); 
  } ) 
  .then( (email) => { 
    // check if there is an item for the user in the collection 
    userEmail = email; 
    return wixData.query("CVOA_members") 
      .eq("_id", userId) 
      .find(); 
  } ) 
  .then( (results) => { 
    // if an item for the user is not found 
    if (results.items.length === 0) { 
      // create an item 
      const toInsert = { 
        "_id": userId, 
        "email": userEmail 
      }; 
      // add the item to the collection 
      wixData.insert("CVOA_members", toInsert) 
        .catch( (err) => { 
          console.log(err); 
        } ); 
    } 
    // update buttons accordingly 
    $w("#button2").label = "Logout"; 
    $w("#button3").show(); 
  } ) 
  .catch( (err) => { 
    console.log(err); 
  } ); 

}
}

export function button3_onclick() {
wixLocation.to(/CVOA-MemberProfile/${wixUsers.currentUser.id});

Sorry, but it’s a lot of code and it’s hard to tell the exact issue from this. I’ll try to be more specific:

  1. What is the issue?
  2. Is the button set to be redirected after click?
  3. Can you send the exact code that you expect to execute?
  4. How is this related to adding a field to the form?
  5. Can you please check the database collection and see if data is added after submission?

Liran.

Specific Issue. When defining the Submit Changes button I have it set to SUBMIT. It DOES update the fields in the database. So far so good. I get the Success Message as defined in the dynamic form. What I am trying to do is have it go to the home page after successful submission. The minute you change Stay On Page to A Link, it seems to populate the LINK field OUTSIDE of the Database Connect Menu and subsequently breaks the form. Submit no longer works because it is obviously confused, since it now has both Submit to datbase AND go to a link. In the YOU TUBE video done my Nayeli, when she changed from Stay On Page to A Link, the video seems to bring up a CHOOSE menu, which I do not see. I know this video was done before release of wix code so maybe thats the issue?

Thanks For Your Help.
JD

Can you please share a link to the page?

https://jds-cvoa.wixsite.com/cvoa

I’m already logged in, just click on My Profile

Ok… try selecting the following:

  1. ‘When successful, navigate to’: ‘A link…’
  2. Choose link as follow:


Liran.

When I choose Navigate to a link… I get this:


Then if I click on A link… or the down arrow I DO NOT GET a choice of pages, only the fields in the database? Therein lies the problem.

I cannot copy the screen because when I click outside this popup, it goes away.

After selecting ‘A link…’, scroll down in the panel:


And click on ‘Choose’.

Liran.

FINALLY! I was “CLICKING” instead of SCROLLING WITH MOUSE WHEEL! I would have expected the Down Arrow next to Link to do the same thing. Thats what I was trying.

Thank You, Thank You, Thank You.

I´m having similar problem when using a dinamic page as destination after form submit. please check attached video.