Bot with Forms in Sharepoint
I have created a Bot having forms. I have registered the bot in dev.botframework.com. The bot is working without any issue in dev.botframework.com. For integrating the chat bot in SharePoint took the iframe for the Web Chat and used it in SharePoint site.
Now I am facing a issue in Chat Bot in SharePoint after the first form appears in the chat window. When ever I enter the message using the enter key, the first form first button data is also going along with the message. Need help to fix this issue.
Once the bot code is embedded in the HTML site I have no issue , but when I embed the iframe chat bot code into Sharepoint site I run into problem that too only when I use the Enter key, instead if I use my mouse and the send button in the chat bot, the issue doesn’t occur.
When I do have the issue it’s something like this: Once the bot shows up a user form with two options I select one, as a answer to the next follow up question I need to type a text and press enter. While I press enter the control is till in the earlier user form with two options. Owing to which once I press enter it sends my typed text to the bot and also clicks the earlier user form, owing to the fact that there is where the control is.
Can you provide more detail? What do you mean by "a Bot having forms"? What do you mean by "the first form first button data is also going along with the message"?

I mean Form bot. The user will be able to click on the form to make a selection. Please find the attached image of Form Bot.
This Form Bot is working fine in html page. The issue happens only when the bot is embedded to share point site.
Once the bot code is embedded in the HTML site I have no issue , but when I embed the iframe chat bot code into Sharepoint site I run into problem that too only when I use the Enter key, instead if I use my mouse and the send button in the chat bot, the issue doesn’t occur.
When I do have the issue it’s something like this: Once the bot shows up a user form with two options I select one, as a answer to the next follow up question I need to type a text and press enter. While I press enter the control is till in the earlier user form with two options. Owing to which once I press enter it sends my typed text to the bot and also clicks the earlier user form, owing to the fact that there is where the control is.
Hi @donjosephgeorge is this only happening in a specific browser? IE ?
Hi @donjosephgeorge...I'm going to try reproducing your issue. It would help for me to understand exactly how you have it deployed in SharePoint.
- Is the iframe referencing a page inside SharePoint or on a CDN somewhere?
- If inside SharePoint...are all the scripts and css local as well?
- What version of the webchat are you using?
- What browsers have you tested this in?
Hi @richdizz,
We are just referring the botframework url inside our sharepoint page. When we embedded the Chatbot into an HTML site works just fine, however when we insert into a SharePoint site as an iFrame we are having this enter key issue.
Code used in Sharepoint page :
Currently the issue observed in IE only.
I believe this may have something to do with IE's compatibility mode. Iframes then may inherit the mode from the parent, IIRC. Can you see open F12 and see which mode you are in?
The default mode is IE -10 . The issue happening in IE 10 only.
If you need to cancel the enter key, it may be as easy as calling
e.stopPropagation();
in the keypress handler
You would need to build your own webchat control.
Closing due to lack of response on the part of OP.