CMS Development

Hubsforero
投稿者

Javascript functions in HTML inputs disappear

解決

   Hi!

   I'm adding code manually to my landings (advanced-->source code), but when inserts the piece of code and save my work, the javascript functions (the events) desappair at every "input" that is having one.

 

  For example, in the next code "onkeyup" and "onchange" events were deleted:

"<input type="text" name="tasa" id="in_tasa" maxlength="9" value="0"

onkeyup="comprobarTasacion(this, hd_tasa)"
onchange="comprobarTasacion(this,hd_tasa)">"
 
 

   Why are my code being deleted??? Is there any step that i'm not following? Is my bad? Does anybody knows what's happening and can help me to solve the issue?

   Thanks in advance!

0 いいね!
1件の承認済みベストアンサー
MatthewShepherd
解決策
キーアドバイザー

Javascript functions in HTML inputs disappear

解決

Hi @Hubsforero 

 

It could be that you are entering your code into a rich text module within your landing page, which can strip out more advanced HTML and JavaScript. You could try editing your template (I'd recommend cloning your template) and adding an HTML module to the template in the area you want to add the JavaScript code. You will need to install the HTML module in your portal first, you can do that by clicking on Marketing->Files & Templates->Hubspot marketplace (in your portal navigation), and then searching HTML. Select the HTML Module and click "Get For Free" and choose the portal to install it to.

 

Matthew Shepherd

Freelance HubSpot Consultant
CRM Consultant | SEO Specialist

Did my post help answer your query?Help the community by marking it as a solution.

元の投稿で解決策を見る

0 いいね!
1件の返信
MatthewShepherd
解決策
キーアドバイザー

Javascript functions in HTML inputs disappear

解決

Hi @Hubsforero 

 

It could be that you are entering your code into a rich text module within your landing page, which can strip out more advanced HTML and JavaScript. You could try editing your template (I'd recommend cloning your template) and adding an HTML module to the template in the area you want to add the JavaScript code. You will need to install the HTML module in your portal first, you can do that by clicking on Marketing->Files & Templates->Hubspot marketplace (in your portal navigation), and then searching HTML. Select the HTML Module and click "Get For Free" and choose the portal to install it to.

 

Matthew Shepherd

Freelance HubSpot Consultant
CRM Consultant | SEO Specialist

Did my post help answer your query?Help the community by marking it as a solution.
0 いいね!