New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Is Select option value not working with ajax when selected value is Php array variable?
I am now confused that if i use php array for a selected option, will it not send variable value to ajax? Because i am stuck with this for last 40 hours (-6hours sleeping). Here is my ajax code and html form with php select option:
Code link with javascript
when i tried to submit form its getting everything on php file except selected value of select option.
So the problem is ajax sending exactly php variable $namedoclist not the selected value. I expect DR1 or DR2 or DR3 whatever i select which is showing via $namedoclist. Was it problem with my ajax code? or it is not possible to pass the php variable value via ajax when using html select option?
Comments
When you echo a string using a single quote, it will output the literal value, which is:
Try:
instead.
or
echo'<option value="' . $namedoclist . '">'.$namedoclist.'</option>';