EasyUI Forum
September 13, 2025, 07:37:31 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to change Easyui elements ID, Name  (Read 6176 times)
Aod47
Jr. Member
**
Posts: 85


View Profile
« on: January 26, 2020, 05:58:01 AM »

I tried code

Code:
$('#old_id').attr("id", 'new_id').attr("name", 'new_name');

but it does not work.

Some hidden input that  generated by Easyui don't change to new id, name.

Could you please advice.

Thank you.

Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: January 28, 2020, 02:03:43 AM »

Please set the 'name' attribute on the form field.
Code:
<input class="easyui-textbox" name="name" style="width:100%" data-options="label:'Name:',required:true">
<input class="easyui-textbox" name="email" style="width:100%" data-options="label:'Email:',required:true,validType:'email'">
Logged
Aod47
Jr. Member
**
Posts: 85


View Profile
« Reply #2 on: January 28, 2020, 06:45:35 PM »

Thank you, Sir.

I check from console and see some attribute was generate by Easyui eg. textboxname, comboname
So I was change attribute value to new_id too. It does work.

Code:
// for textboox
$('#old_id').attr('id', 'new_id').attr('name', 'new_id').attr('textboxname', 'new_id');
// and change hidden input to
$('.textbox-value[name="old_id"]').attr("name", new_id);

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!