Support the ongoing development of Laravel.io →
Views Blade Forms
Last updated 2 years ago.
0

Are you looking to dynamically insert this value into your anchor tag?

For example, if the user selects an option in the dropdown, the link in the anchor will update automatically after selection.

Or, if the user enters a value in the text box, then on blur you capture the value then automatically update the anchor. You could bind the functions for this like so.

$("input").focus(function() {
    console.log('user is in the box');
}).blur(function() {
    console.log('user left the box');
});

Let me know if I understand your question right.

0

I just need to pass this parameter to my route

0

"{{ URL::to('home/otherpage', $params) }}". This action is asking for parameter.

I'm trying to get this value from a text box. Which is an id of a table. Here is my route:

Route::get('customer/{id}', function($id) { $customer = Customer::find($id); return View::make('customers/single') ->with('customer', $customer);

As you can see this route is looking for parameter id(which is the primary key of customer table). I'm getting this parameter from a select box and passing it to a hidden field. Then on button click I run the above url. I need to pass this to the route as the primary key for the view named single.

If it doesn't work this way. I'm open for other suggestions.

0

To help understand I'm taking user input for my view and passing it to a route. Then I will take it from there I do other functions. My problem is passing value from view to route. Thank you

0

When you're passing the value to the route you need to specify the keyname of the route parameter like so:

{{ URL::to('home/otherpage', ['id' => $params]) }}

Let me know if this helps

0

Sign in to participate in this thread!

Eventy

Your banner here too?

dendic dendic Joined 30 Dec 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.