Click here to Skip to main content
15,888,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one form in Html,
HTML
<form id="myform" autocomplete="off">
<div class="row 50%">
<div class="6u 12u(mobile)">
<input id="your_message" name="your_message" type="text" placeholder="What are you looking for?">
<input type="submit">
</div>
</div>
</form>

XML
<script>


jQuery('#myform').submit(function() {
ajax('{{=URL('new_post')}}', ['your_message'], 'target')
$(function(){$("#searchresult").show();});
$('html, body').animate({
scrollTop: $("#searchresult").offset().top }, 2000);
return false;
});


</script>



I want to submit this form and i want to display the results in the target div. Text box acts as a search box and after submitting it is supposed to fetch datat from the Controller( from the database) and should dispaly the results in target div withour page refresh. Also, the results which will be row or databases, i want to display them in the form of hyperlink. so that I can click on it and go further on another page. How can i make my results hyperlink.Results are coming in target div.Thanks in advance
Posted
Updated 29-Jun-15 23:44pm
v4
Comments
Member 11491784 30-Jun-15 5:25am    
*row from database
F-ES Sitecore 30-Jun-15 5:33am    
You've basically listed an incredibly vague "I need a website" requirement and are now wanting someone to write it. This isn't a code-writing service, break the problem down into parts and tackle them and ask specific questions if you have a problem, people aren't going to do your work for you.
Member 11491784 30-Jun-15 5:43am    
I updated it, if you can help me now, I think it will be a great help
Member 11491784 30-Jun-15 5:35am    
I am asking how to deseralize the result so that I can make it a hyper link. I got result with the help of ajax and jquery

Just use JQuery if you want something dead simple

http://api.jquery.com/jquery.post/[^]

Specifically this example :

Example: Send form data using ajax requests

$.post( "test.php", $( "#testform" ).serialize() );


You will need to tailor it for you needs and wire up the callback, but everything you need is on that page
 
Share this answer
 
v2
Comments
Member 11491784 30-Jun-15 5:32am    
Do you have any idea how it will work in python?
Jquery is a client side thing, it runs in the browser so it would not care if you were using Python or not. It happens in the browser.
 
Share this answer
 
v2
Comments
Member 11491784 30-Jun-15 5:56am    
That is true, but the results i am getting from python code. and how can i view them so that i can make particular column as a link.
Python code is givng result by row.xml and this jquery code is just displaying that into target div

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900