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.
"{{ 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.
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
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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community