# Ajax post and return

**URL:** <https://forums.realmacsoftware.com/t/ajax-post-and-return/33703>\
**Category:** RapidWeaver Classic\
**Created:** [July 7, 2020, 2:16am UTC](https://forums.realmacsoftware.com/t/ajax-post-and-return/33703 "2020-07-07T02:16:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krazay](https://avatars.discourse-cdn.com/v4/letter/k/a9adbd/32.png) [@Krazay](https://forums.realmacsoftware.com/u/Krazay)\
**Post date:** [July 7, 2020, 2:16am UTC](https://forums.realmacsoftware.com/t/ajax-post-and-return/33703/1 "2020-07-07T02:16:09Z")

</div>

$(“input[id=‘input\_drink\_item’]”).val(newD[1]);  
$(“input[id=‘input\_drink\_item\_price’]”).val(newD[2]);  
$(“input[id=‘input\_drink\_description’]”).val(newD[3]);  
// $(‘select#input\_drink\_catagory’).val(newD[4]);  
$(“input[‘drink\_catagory’]”).val(newD[4]);  
//$("#input\_drink\_catagory").val(newD[4]);

I am in RW Foundation 6 using the text input and select … I post with Ajax and get my return, but having problems with an edit form where it returns the certain row from the database, and lets who controls the form to edit. I can return the text inputs by the above code, however, the select is not changing no matter what I try. I had problems at first the text inputs and could not use $(’#input\_drink\_item).val(‘whatever’); found an alternative  
$(“input[id=‘input\_drink\_item’]”).val(newD[1]); If this line works what could I use to change the value of a select?  
I have success if I call $(’#drink\_catagory).val(‘wine’) and it selects it from the console of my web bowser.  
Any help would be helpful!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/system/32/25301_2.png) [@system](https://forums.realmacsoftware.com/u/system)\
**Post date:** [August 6, 2020, 12:16pm UTC](https://forums.realmacsoftware.com/t/ajax-post-and-return/33703/2 "2020-08-06T12:16:12Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
