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
I want get input field from user #49
Comments
Have a look at the DOM Events documentation page. That shows how to register to handle a DOM event (such click, or others). To get the |
Closing this, feel free to re-open if more questions or something isn't clear the docs. |
I have a question about this. I'm having a hard time getting the value using syscall/js. Here is the relevant portion of my component:
And in my go code:
As a test, I'm trying to change the label (name) displayed next to the text box, but it isn't working. I'm at a loss here. Any advice @bradleypeabody ? I'm using this for the form validation tutorial. |
A couple things I see at first glance:
Try fixing those points and see how it goes. |
Thanks for that. I hadn't noticed those things. However, it didn't change anything. Is there a way for me to tell if the function was even called? log.Printf doesn't work. |
log.Printf should indeed work, also fmt.Printf. If there's no output I would suspect your function is still not being called. Are you sure that whatever you are doing it invoke it would cause the 'submit' event to be fired? You might try some other events like 'click', 'keydown', 'mouseover' in order to isolate if no events are being fired at all or if it's only specific ones that are having trouble. That might help narrow it down. |
@ScreamingTaco This program works with a submit event:
|
Also don't get tripped up by browser cache. Just today I was running into "log statements not working" and it turned out to just be the browser had cached the earlier version. There is some stuff in place in Vugu to mitigate this, but still... don't be shy about "Empty Cache and Hard Reload" if any doubt. |
Yep, emptying the cache was what I needed. Now it is showing log messages. I still haven't gotten the js to work, but now I have errors to work with. Thanks! |
@bradleypeabody |
@itstmyi Getting there - making steady progress but it's quite a bit of work. I hope to have the basic new DOM syncing mechanism working for markup by the end of this weekend and then follow up with events and type-safe components right after. |
Question
...your question...
get user a inbox field , how to get it and use in HandleClick of example ?
in root.vugu I have a input and a function call,
in root-data.go have a function
I want to use input field as value when I click button, and fetch server api
Is your question related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Suggested Changes
If applicable, please provide any suggestions of how to improve.
Additional context
Add any other context, info, files, etc. related to your question.
The text was updated successfully, but these errors were encountered: