Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can i put a form in notice type jbox? #14

Closed
nhaemu opened this issue Sep 11, 2014 · 7 comments
Closed

can i put a form in notice type jbox? #14

nhaemu opened this issue Sep 11, 2014 · 7 comments

Comments

@nhaemu
Copy link

nhaemu commented Sep 11, 2014

No description provided.

@nhaemu
Copy link
Author

nhaemu commented Sep 11, 2014

i want to use jbox notice as incoming message which showing data and two buttons. I insert string of element in content. but when i click button it does not work.

@StephanWagner
Copy link
Owner

Sorry for answering so late! If you are still having that problem, could you provide some code, so I can have a look at what you are trying to do.

@nhaemu
Copy link
Author

nhaemu commented Sep 30, 2014

The problem is solved. I declared button click event like this:
$(body).on('click', '#aaButton', function() {
myFunction();
}

@StephanWagner
Copy link
Owner

Ok, its not the nicest solution, but if it works for you, all right.
If you still want me to have a look at it, post some code how you open the notice, I might have a more solid solution.

@StephanWagner
Copy link
Owner

Ah, OK, I see what you'd like to do.

Firstly, I think you would be better off creating this with a jBox 'Modal' as jBox Notices normally are only useful to show a notice and then disappear. Let me know if you like a jBox Modal Example that has the same functionality as your example, I'd be more than happy to create one.

Meanwhile, your code does work, but I have a few improvements if you like:
$('body') - clicks should generally be avoided, read Section Event performancy here: http://api.jquery.com/on/
I would just add an onclick event to the button.

Also, Notices close themselves when you click on the notice itself (anywhere). So I would add the option closeOnClick: false. And then I would store the notice reference in an object so you can close it manually.

See this fiddle here, thats how I would do it with type Notice: http://jsfiddle.net/StephanWagner/gybpytr4/

But as I said above, you could achieve the same behavior with type Modal.

@nhaemu
Copy link
Author

nhaemu commented Oct 1, 2014

Thanks you very much.

@StephanWagner
Copy link
Owner

That must be an error on your side then. When you define the function in global scope, the onclick="" of the button will find it.

Alternatively you could also just add the doCheck function when jBox has been created:
http://jsfiddle.net/StephanWagner/gybpytr4/2/

@nhaemu nhaemu closed this as completed Dec 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants