0

I want to get array data from a Input value in JavaScript. The Name for each selected one Name Like, I want to get The name 'John' Or i want to get the mail 'Doe'

This is PHP

$AllValue['1'] = array(
    'Name' => 'John',
    'Email' => 'john@gmail.com'
);
$AllValue['2'] = array(
    'Name' => 'Doe',
    'Email' => 'doe@gmail.com'
);

This is my HTML

<input type="text" class="" value="<?php echo $AllValue; ?>">

please help by give me that code

<script>
// please help by give me that code
</script>
Feroz Ahmed
  • 786
  • 9
  • 16
  • 1
    Possible duplicate of [Pass a PHP array to a JavaScript function](http://stackoverflow.com/questions/4885737/pass-a-php-array-to-a-javascript-function) – jaypb Apr 07 '16 at 19:23
  • 1
    You need to break down the steps and figure out what you are trying to actually accomplish. You are actually trying to read php data in javascript, I would recommend googling that first. Also, asking for people to write your code for you is generally considered poor form. – jaypb Apr 07 '16 at 19:24
  • You want the input to show the value "John" or "Doe"? Which of the two, on which grounds? Do you want the user to actually input those values? What if they enter yet another value? It is not clear what you actually want to happen. – trincot Apr 07 '16 at 19:25
  • "please help by give me that code" No. Start by trying to access the value of the input element normally, plug it into a debugger and start messing around with it. When you get stuck, come back with a specific question! – mejdev Apr 07 '16 at 19:42

0 Answers0