+ 9
Attempting to make a cool Search bar.. (please help)
I was making a code with different searches from websites, but I thought I could make one search bar and many Submit Search Buttons (1 submit button for each website with search https://code.sololearn.com/WjeQsUNg3i22/?ref=app
13 Respostas
+ 7
Ok so what is the question? Do you need help with the design? Or with the implementation?
+ 6
Alex Pshenichny Bran Wolfe Check this out
+ 6
Sandra Meyer I still donât get it
+ 5
đ„ Alex TuÈinean đș I want help with the code because earlier I used this:
<form action="https://search.yahoo.com/search" target="_blank" >
<input class="myInput"placeholder="Search" type="search"name="p">
<button class="button" type="search"value="submit">Search</button>
Now I want that somehow there is only one search field but one submit serach button for each search engine
+ 5
Sandra Meyer How should I do that? Can you please show me an example based on https://code.sololearn.com/WjeQsUNg3i22/?ref=app
THank you so much
+ 5
Sandra Meyer the problem is that the form action attribute does not work. Is there a way that the form action attribute and the input name attribute changes based on what submit button you press?
+ 5
Sandra Meyer ok thanks
+ 4
+ 3
You'll need the formaction-attribute for the multiple buttons. Use it similar to action of form.
+ 3
You can modify the names of query parameters for each button individually. Use name="queryParam" for each button.
+ 3
See modified code. I added some working links and set a default query param and a user defined one.
+ 3
Oh you want to execute some additional code? Then you just have to wrap it around. Otherwise you don't need the form action attribute.
+ 3
If you want to change the form dynamically you'll have to code it. Butt what exactly do you want to change? Why do you want to use the form action attribute? Why not the button's one?