I want a 2nd button to appear only after pressing the 1st button

I have two buttons in a lightbox.

1st button is SUBMIT (#button2)
2nd button is CLOSE (#button3)

Only after pressing SUBMIT do I want CLOSE to appear.

I set #button3 as hidden on load
I set # button 2’s event handler (ONCLICK) code as:
(Strangely, no code is appearing for either button in the code window)

I don’t know why no code is showing, I’ve got CORVID enabled. Anyway, I’ll probably just delete both buttons and create new ones … in the meantime, what would the code be for both #button2 and #button3 ?)

Thanks

Hey H G R!

Try something like this on the page code:


$w.onReady(function(){  
$w("#button3").hide()
 $w("#button2").onClick(function() {
    $w("#button3").show()
})
})

Or you can use the “hidden on load” on the properties, and use this:

$w.onReady(function(){  
 $w("#button2").onClick(function() {
    $w("#button3").show()
})
})

I hope this helps :slight_smile:

Cheers,

Erikson

ME LIKE … yeah, the first one is cleaner and easier to understand. THANKS Erikson

Just another quick question. … the first one works fine.
I’d like to have #button2 disappear once clicked then have #button3 show in it’s place. I’ve layered #button3 on top of #button2, but #button2 still appears above #button3. Currently #2 still shows.

Can I assume that I can add an event handler as shown on line 3 ?

$w.onReady(function(){  
 $w("#button2").onClick(function() {
    $w("#button2").hide
    $w("#button3").show()

Thanks Heath - actually it didn’t work in the order I stated, but switched line 3 and 4, then it works.
So, CORVID and WIX don’t talk? Jheeez. With the time it takes to make a successful database (which is getting easier with time), we now have to worry that a WIX update might make our hard-earned time useless or even partially dysfunctional ? I have two words for that GROAN, WHINE.

Cheers

I’ve got one dirty four letter word for that >> BETA << Thanks for the info.