Buttons stop working on form screen

More
5 years 2 months ago #84193 by DonMartin
DonMartin created the topic: Buttons stop working on form screen
I am running LS 1.92+ Build 120405 (Ubuntu, Apache). I have a question with a google map that requires data input, for this I am using some custom JavaScript with a custom HTML form, this works perfectly.

However, the Next/Previous/Submit buttons on this question do not work on Internet Explorer, they work fine on Firefox and Chrome. I thought it was the JS causing the issue but have found it is the form itself or more precisely the closing form tag </form>.

The error I get is:

Message: 'document.limesurvey.move' is null or not an object

Here is the HTML that is causing the issue, note that this works as it should and LS works as it should if the closing form tag is removed:

<form name="maptype" action="">
<input type="text" id="address1id" name="address_one" />
<input type="text" id="address2id" name="address_two" />
<input type="button" name="mapsubmit" value="Get my route" onclick="getmap();" />
</form>

So I can get it to work but is there anyway I can resolve this so I am using the HTML correctly and getting LS to work?

Please Log in to join the conversation.

More
5 years 2 months ago #84198 by tpartner
tpartner replied the topic: Buttons stop working on form screen
I suspect that the problem is that you are putting a form inside a form which is invalid HTML. (the survey elements are in <form id="limesurvey">)

I think you should be able to leave out both the opening and closing <form> tags.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 2 months ago #84241 by DonMartin
DonMartin replied the topic: Buttons stop working on form screen
Thank you. I got hung up on placing the inputs within a form, as you say having the form within the existing LS form was causing the error. I should have realised right away.

I have removed both the opening and closing form tags and it works perfectly. It is strange how this error only showed itself when using IE but was ignored by other browsers.

Thank you for your help.

Please Log in to join the conversation.

More
5 years 2 months ago #84243 by tpartner
tpartner replied the topic: Buttons stop working on form screen
You're welcome.

Yeah, IE is VERY sensitive about valid HTML and JavaScript.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now