Greetings, can someone help me on this? I'm really out of ideas.

What i need to do is when i click the link the value of it's ID should be pass on the label inside the modal.

Here's my code:

<div class="row">
    <div class="large-12 columns">
        <label id="devFont">-Device-</label>
        <div class="row">
            @foreach ($deviceList as $devList)
            <div class="row">
                <div class="large-6 columns">
                    <label id="txtMargin">{{++$ctr, ".  ", $devList->device_name }}</label>
                </div>
                <div class="large-5 columns">

                    {{ link_to('', 'Assign', $attributes = array( 'id' => $devList->device_name, 'class' => 'button tiny large-0 radius', 'title' => 'Assign a device to a person', 'data-reveal-id' => 'assignModal', 'name' => 'assignDev')) }}

                    {{ link_to('', 'Edit', $attributes = array('class' => 'button tiny large-0 radius', 'title' => 'Edit a Device')) }}

                    {{ link_to('Item/delete/ '. $devList->id, 'Delete', $attributes = array('class' => 'button tiny large-0 radius', 'title' => 'Delete selected Device', 'id' => $devList->id)) }}

                </div>
            </div>
            @endforeach
        </div>
    </div>
</div>

And here's my code on my modal:

<div id="assignModal" class="reveal-modal small" data-reveal>

    {{ Form::open(array('url' => 'adddevice')) }}

    <div class="row">
        <div class="large-12 columns">
            <div class="large-9 columns">
                @foreach ($devName as $deviceN)
                {{ Form::label('device', $deviceN->device_name , array('id' => 'modalLbl')) }}
                @endforeach
            </br>

            </div>

            <div class="large-12 columns">

                {{ Form::label('', "Person's name", array('id'=>'Font')) }}

                {{ Form::text('personTb', '' , array('placeholder' => 'Enter Persons name')) }}

                {{ Form::label('', "Cubicle's Number", array('id'=>'Font')) }}

                {{ Form::text('cubicleTb', '' , array('placeholder' => 'Enter Cubicle Number')) }}

            </div>
        </div>

            <div class="large-12 columns">
                <div class="large-2 columns">
                    {{ Form::submit('Deploy' , $attributes = array('class' => 'button tiny small-0 radius', 'name' => 'submit')) }}
                </div>
            </div>
        </div>

        <a class="close-reveal-modal">&#215;</a>

    </div>

    {{ Form::close() }}

</div>

Thank you in advance.

Solved in now! What i did is.

I change this

{{ link_to('', 'Assign', $attributes = array( 'id' => $devList->device_name, 'class' => 'button tiny large-0 radius', 'title' => 'Assign a device to a person', 'data-reveal-id' => 'assignModal', 'name' => 'assignDev')) }}

to this

{{ link_to('', 'Assign', array('onclick' => 'deviceProperty('. $devList->id .', "'. $devList->device_name .'")', 'data-reveal-id' => 'assignModal' , 'class' => 'button tiny large-0 radius' )) }}

and changed the label's name to this:

{{ Form::label('','', array('name' => 'labelDevice', 'id'=>'devLabel', 'class' => 'deviceLbl')) }}

and created a hidden field for the device's id:

{{ Form::hidden('', '', array('name' => 'idTb', 'id'=>'id_textbox')) }}

And i added a <script> to pass the values to the label

    <script>
    function deviceProperty(id, device_name) {
        document.getElementById("devLabel").innerHTML = device_name;
        document.getElementById("id_textbox").innerHTML = id;
    }
    </script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.