Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. function fillField(section, title, data){
  2. jQuery("iframe").contents().find("legend:contains(" + section + ")").first().parent().find("label:contains(" + title + ")" ).filter(":visible:first").parent().next().find("input").filter(":visible:first").trigger('click').val(data).trigger('change');
  3. }
  4.  
  5. data = {
  6. 'Паспортные' : {
  7. 'Кем выдан': 'кем',
  8. 'Код подразделения': 'код',
  9. },
  10. 'Адрес заявителя' : {
  11. 'Почтовый индекс': 'Значение',
  12. 'Город (нас.пункт)': 'Значение',
  13. 'Улица': 'Значение',
  14. 'Дом': 'Значение',
  15. 'Квартира': 'Значение',
  16. },
  17. 'Информация о ребёнке': {
  18. 'СНИЛС' : 'Значение',
  19. 'Фамилия' : 'Значение',
  20. 'Имя' : 'Значение',
  21. 'Отчество' : 'Значение ',
  22. 'Дата рождения' : 'Значение',
  23. },
  24. 'Свидетельство' : {
  25. 'Серия' : 'Значение',
  26. 'Номер' : 'Значение',
  27. 'Дата выдачи' : 'Значение',
  28. 'Кем выдано' : 'Значение',
  29. 'Номер записи' : 'Значение',
  30. },
  31. 'Адрес ребёнка': {
  32. 'Почтовый индекс' : 'Значение',
  33. 'Город (нас.пункт)' : 'Значение',
  34. 'Улица' : 'Значение',
  35. 'Дом' : 'Значение',
  36. 'Квартира': 'Значение',
  37. },
  38. 'Отец ребёнка': {
  39. 'Фамилия' : 'Значение',
  40. 'Имя' : 'Значение',
  41. 'Отчество' : 'Значение',
  42. },
  43. 'Мать ребёнка': {
  44. 'Фамилия' : 'Значение',
  45. 'Имя' : 'Значение',
  46. 'Отчество' : 'Значение',
  47. }
  48. }
  49. //Отключить мальчика
  50. jQuery("iframe").contents().find("legend:contains('Информация о ребёнке')").first().parent().find("label:contains(Пол)" ).filter(":visible:first").parent().next().find("input:radio").filter("[value='1']").prop('checked', false);
  51. //Включить девочку
  52. jQuery("iframe").contents().find("legend:contains('Информация о ребёнке')").first().parent().find("label:contains(Пол)" ).filter(":visible:first").parent().next().find("input:radio").filter("[value='2']").prop('checked', true);
  53.  
  54.  
  55. jQuery.each( data, function( section, fields ) {
  56. jQuery.each( fields, function( title, data ) {
  57. fillField(section, title, data) ;
  58. });
  59. });
  60. //Галки внизу
  61. jQuery("iframe").contents().find('input:checkbox[name="confirm"]').prop('checked', true);
  62. jQuery("iframe").contents().find('input:checkbox[name="norobotsallowed"]').prop('checked', true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement