How to fix error "Syntax error, unrecognized expression: '#[object HTMLInputElement]"


Hi, 

I'm working with Traditional web app OS11 and I'm having a problem, hope you guys can help me fix it.

the case is: i have a search filter, each time i click "Reset" button, i want all my input fields to become blank. all the input fields work fine, except one. the Google Location field (this i use AddressAutocomplete webblock from module M_Autocomplete)

I've tried to do it with javascript (JS). the step is very simple:

1. define a function using Jquery in the webblock SearchingFilter
2. then use the server action RunJavaScript in the "Reset" action flow to do the job

the problem is, with the most properly way - a JS function ResetGoogleLocation with a parameter passed in as the runtime id of the input field GoogleLocation to avoid hardcode - i got the syntax error that i dont know how to fix it (picture bellow)

So i try to do the simple way, is to pass the runtime id directly into another JS function ResetLocation, and it works.

In short, both function are quite the same, just a bit different that ResetGoogleLocation has the parameter passed in and ResetLocation doesn't, it has a hardcode runtime id instead.

I know this issue seem to be very simple, but it got me struggling, i've tried to find the solution in many forums but still can't solve it.

P/s: I assign the runtime id of the GoogleLocation input field to local var RuntimeIdLocation in the Assign node of the "Reset" flow

thanks and regards.

Minh.





Might be a silly question but have you tried without the encode javascript function? 

Mariano Picco wrote:

Might be a silly question but have you tried without the encode javascript function? 

 

 Yes, i did try with the edcode JS function, you can see it in the attached picture, but it doesn't work. it throws out the error that i've mentioned

Solution

Hi guys, i've fixed my problem.

just a little bit adjustment in the JS function and the value of the RunJavScript server action.

i think the key is the javascript fuction should be simple, should not contain any string character and string concatenation 

hope this post help you guys with the same issue.

thanks and regards.

Minh


Solution