Copy link to clipboard
Copied
Hi guys,
I'm simply trying to add ajax submission to the Web App Upload Form and not having any luck. Is it possible for this particular form or not campatable?
Below is the "action" attribute:
action="/CustomContentProcess.aspx?CCID=14722&OID={module_oid}&OTYPE={module_otype}&JSON=1"
I take it this particular form doesn't allow for JSON as I'm not having any issues with other forms.
If anyone has achieved this before it would be great to hear that it's possible.
Cheers,
Copy link to clipboard
Copied
Problem solved I have it working.
Copy link to clipboard
Copied
Do you sharing the resolution...I'm having the same problem
Copy link to clipboard
Copied
Would you share how you solved the problem? Thanks.
Copy link to clipboard
Copied
anyone have the solution to post here?
Copy link to clipboard
Copied
You can not get a json response as it is only supported on web forms but it is a post and in jquery for example you have .post() and .ajax() - Read up on them and you can submit any form through ajax. You just need to learn and understand how to handle the responses that are returned.
Copy link to clipboard
Copied
Hi Liam, really appreciate your advice so far!
I've spent quite a bit of time on this but I'm still a novice at jquery which doesn't help. This is what I've come up with so far:
http://www.kiph.co.za/catalog_test3.html
I can't seem to process the form successfully. I've tried intergrating http://demo.businesscatalyst.com/json-form technique but as you pointed out /Default.aspx doesn't elicit a json response. Was just wondering if you had any suggestions on what I've done so far?
Wes
Copy link to clipboard
Copied
http://api.jquery.com/jQuery.ajax/
Follow that, key is the data type your getting.
If it is not JSON what happens when you fill in a form normally, what is the result? A page hey, so that would mean it is......
Copy link to clipboard
Copied
Ok so that got me to pull an all nighter, thanks Liam .
I seem to have to the form to work except for some minor issues. First is the form keeps on duplicating itself, this is hidden but I'm unsure if it might be problematic later on... Second is I'm occasionally getting an error Object repose for some reason... might be my syntax?
Here the demo: http://www.kiph.co.za/catalog_test3.html
Here's the code:
<script type="text/javascript">
function jqsub() {
var $f = $('#contact_form');
var $m = $('#message');
$.ajax({
type: 'POST',
url: "/Default.aspx?CCID=30913&FID=155131&ExcludeBoolFalse=True&PageID={module_oid}",
dataType: "html",
data: $f.serialize(),
success: function(data) {
var formResponse = data;
$('#message').html(data);
$f.fadeOut(); //Hide the form
//Hide the form $f.fadeOut();
},
error: function(data) {
alert('error'+data);
return false;
}
});
}
</script>
<!--<script type="text/javascript">
$(document).ready(function(){
if( document.URL.indexOf("Default.aspx") < 0){
$("#CAT_Custom_471904 > [value='{module_visitorcountrycode}']").attr("selected", "true");
$("form[name='catcustomcontentform83165']").submit();
}
})
</script>-->
<div id="message">
{module_webappsresults}
</div>
<form name="catcustomcontentform83165" method="post" onSubmit="return jqsub()" action="" id="contact_form" enctype="multipart/form-data">
<div class="webform">
<div class="item">
<label for="CAT_Custom_471904">Country</label>
<br />
<select name="CAT_Custom_471904" id="CAT_Custom_471904" class="cat_dropdown" onChange="jqsub()">
<option value="*">-- All --</option>
<option value="AC">AC</option>
</select>
</div>
<div class="item">
<input class="cat_button" type="submit" value="Search" />
</div>
</div>
</form>
Any suggestions?
Copy link to clipboard
Copied
Have you viewed the console to see what happens when you post so you know what actually is returned with data? , Because it is html you do not need to serilize it. Here is what that does;
http://api.jquery.com/serialize/
Best question for me is what are you trying to achieve? It hard to understand the goal.
I can see you are trying to self post to the same page, You can use self page loading to counter some issues but it may be easier for you at first to have the webapp results on another page and change the pageid to id and a specified page and post to that page and only have the results there. Your data will contain the whole html and you can then easily find and filter out the content you want and render it in a div.
Copy link to clipboard
Copied
Hi Liam,
My objective is to display the relevant shipping details of an item on the Products Detail Page (For example ETA, Shipping Cost, Shipping Method and Return policy). On the product detail page load i would like to have the customers current country details displayed automatically (using {module_visitorcountrycode}) however maintain the option for the user to change the shipping destination to alternative countries.
I'm hoping too achieve a similar functionality to eBay’s "shipping details" at the end of the day.
When using the demo(http://www.kiph.co.za/catalog_test3.html) select ZA from the dropdown to see the desired response.
Hope this gives you a better understanding of what I'm trying to achieve?
Copy link to clipboard
Copied
Confusing because your doing web apps etc not products and you can achieve shipping options just using attributes on products and css for visitor country selctions and bits of scripts. I etheir mentioned that to you in another thread or someone else.
You can cut half of what your doing and be a lot more siplistic in implementation and achieve exactly the same as I see it.
Sorry, bit confused to what your doing.
Copy link to clipboard
Copied
Hi Liam, the reason I'd like to go with the web app is that I'll be setting up international shipping for a number of countries plus with the web app I can use the same database in the support section and other parts of the site.
I've basically got the web app working fine now (http://www.kiph.co.za/catalog_test3.html ), the only issue now is that when I copy the code into the product details page the form returns a 404 error back form the action url...
I'm not to sure why this is happening but I've got a feeling that I could be the {mo dule_oid} is the page ID rather than the web app ID?
Copy link to clipboard
Copied
Get a default web app submission form and just the action, yours is incorect.