Find Jobs
Hire Freelancers

Drupal Form AJAX

$30-250 USD

ที่ทำเสร็จแล้ว
โพสต์ มากกว่า 10 ปีที่ผ่านมา

$30-250 USD

ชำระเงินเมื่อส่งงาน
Hi, I have created a simple webform which have two select fields. I want that when user select first select option then second select box is updated with values relevant to selected option. I have created a custom form and tried using form AJAX property. This work fine but the only issue is that when I change any value then it still sends a default value rather than selected value. I think the problem is with form_state but I could be wrong. function apply_now_form_webform_client_form_69_alter(&$form, &$form_state) { $options = _apply_now_get_car_makes_dropdown_options(); $selected = isset($form_state['values']['car_make']) ? $form_state['values']['car_make'] : key($options); $form['submitted']['car_make']['#options'] = $options; $form['submitted']['car_make']['#default_value'] = $selected; $form['#submit'][] = 'your_submit_handler'; $form['submitted']['car_make']['#ajax'] = array( 'callback' => 'apply_now_dependent_dropdown_callback', 'wrapper' => 'dropdown-second-replace', 'method' => 'replace' ); $form['submitted']['car_model']['#prefix'] = '<div id="dropdown-second-replace">'; $form['submitted']['car_model']['#suffix'] = '</div>'; $form['submitted']['car_model']['#options'] = _apply_now_get_car_model_dropdown_options($selected); $form['submitted']['car_model']['#default_value'] = isset($form_state['values']['car_make']) ? $form_state['values']['car_make'] : ''; } In the second last line in code, you will n otice that $selected is passed but this is always the first value in $options rather than what user selected. Thanks
รหัสโปรเจกต์: 5149898

เกี่ยวกับโปรเจกต์

1 ข้อเสนอ
โปรเจกต์ระยะไกล
ใช้งานอยู่ 10 ปีที่ผ่านมา

กำลังมองหาการสร้างรายได้ใช่ไหม?

ประโยชน์ของการประมูลกับ Freelancer

กำหนดงบประมาณและกรอบเวลาของคุณ
รับเงินจากการงานของคุณ
อธิบายข้อเสนอของคุณในภาพรวม
ลงทะเบียนและเสนอราคาฟรี
หมอบหมายให้:
รูปอวาตาร์ของผู้ใช้
I can fix it. I ready begin now. ======================================================================================================================================================
$34 USD ใน 0 วัน
4.8 (153 รีวิว)
6.8
6.8

เกี่ยวกับลูกค้า

ปักธงของ UNITED KINGDOM
Leeds, United Kingdom
4.9
210
ยืนยันวิธีการชำระเงินแล้ว
เป็นสมาชิกตั้งแต่ ส.ค. 19, 2009

การยืนยันลูกค้า

ขอบคุณ! เราได้ส่งลิงก์สำหรับเครดิตฟรีให้คุณทางอีเมลแล้ว
เกิดข้อผิดพลาดขณะส่งอีเมลของคุณ กรุณาลองอีกครั้ง
โลโก้ Freelancer Thailand / ภาษาไทย ช่วยเหลือและสนับสนุน FreelancerประเภทโปรเจคการประกวดFreelancerองค์กรแพ็กเกจสมาชิกโครงการ Freelancer ชั้นแนวหน้าการจัดการโปรเจคงานในพื้นที่Photo Anywhereหน้าจัดแสดงผลงานAPI สำหรับนักพัฒนาได้รับการยืนยันDesktop App เกี่ยวกับเกี่ยวกับเราวิธีใช้งานความปลอดภัยนักลงทุนแผนผังเว็บไซต์เรื่องราวข่าวออกสื่อทีมรางวัลข่าวประชาสัมพันธ์ร่วมงานกับเรา ข้อกำหนดนโยบายความเป็นส่วนตัวข้อกำหนดและเงื่อนไขนโยบายลิขสิทธิ์ข้อพึงปฏิบัติค่าธรรมเนียมและค่าบริการหุ้นส่วนEscrow.comLoadshiftWarrior Forum แอปโลโก้ Apple App Store โลโก้ Google Play
ไม่สามารถคัดลอกไปยังคลิปบอร์ดได้ โปรดลองอีกครั้งหลังปรับเปลี่ยนการอนุญาต
คัดลอกไปยังคลิปบอร์ดแล้ว
ผู้ใช้ที่ลงทะเบียน งานที่มีการโพสต์ทั้งหมด
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
กำลังโหลดตัวอย่าง
ได้รับอนุญาตสำหรับตำแหน่งทางภูมิศาสตร์
เซสชั่นการเข้าสู่ระบบของคุณหมดอายุและคุณได้ออกจากระบบแล้ว กรุณาเข้าสู่ระบบอีกครั้ง