Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    General discussion    Topic: [solved] input field values clears on load
Pages: [1]   Go Down
  Print  
Author Topic: [solved] input field values clears on load  (Read 1062 times)
0 Members and 1 Guest are viewing this topic.
alekks
Newbie
*

Karma: 0
Offline Offline

Posts: 4


« on: June 25, 2012, 00:10:26 »

Hi,

The values I've been entering in the input fields disappears when the page loads, I can see the value flash by.
<input id="comments-form-email" type="text" name="email" value="Din E-postadress" tabindex="2" />

Can't find an answer for why it get's cleared so I can't find an solution to the problem.

Found another thread two years back but the solution in that thread didn't make any difference...

Hope you can help me with this, thanks!
« Last Edit: June 26, 2012, 02:50:51 by alekks » Logged
smart
Administrator
Hero Member
*****

Karma: 163
Offline Offline

Gender: Male
Posts: 2161



WWW
« Reply #1 on: June 25, 2012, 14:17:02 »

This is because one feature of JComments which stores last used name and email in cookies and restore these values when user (guest) opens the page with JComments form. You can remove this behavior by small modification:

1. Open file /components/com_jcomments/js/jcomments-v2.3.js
2. Replace code:
Code: (php)
storeValues: function(){for(var i=0;i<this.store.length; i++){try{var el=JComments.prototype.$(this.id+'-'+this.store[i]);if(el){JComments.prototype.setCookie(this.store[i],encodeURIComponent(el.value),14);}}catch(e){}}},
restoreValues: function(){for(var i=0;i<this.store.length; i++){try{var el=JComments.prototype.$(this.id+'-'+this.store[i]);if(el){if(el.type&&el.type=='hidden'){return;}else{el.value=decodeURIComponent(JComments.prototype.getCookie(this.store[i]));}}}catch(e){}}},
with
Code: (php)
storeValues: function(){},
restoreValues: function(){},

Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
alekks
Newbie
*

Karma: 0
Offline Offline

Posts: 4


« Reply #2 on: June 26, 2012, 02:51:33 »

thanks for the help!

for some reason this didn't work when I tried it earlier... But it does now. Smiley

Thanks again!
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: [solved] input field values clears on load
 
Jump to: