views:

19

answers:

2

I have created an HTML Autorun which run from a CD, there is a contact form in it. How can I submit it to my server? I think the common orgin problem is creating issues for me. None if the jquery ways seems to work.

UPDATE: I want to submit by ajax, jquery will first check if internet is connected and then submit. The autorun will be loaded in XULRunner bundled in the CD so running javascript won't be an issue.

+2  A: 

I think that the traditional

<form method="post" action="http://yoursite.com/contact.php"&gt; 

should work. Altough I never sent data to another domain like that before.

Claudiu
A regular form will work. The ajax thing won't because of the common origin policy.
Noufal Ibrahim
Yeah, my thoughts exactly. What I wasn't sure of is putting a full URL as the action attribute, I never did that before. Thanks for clearing it up!
Claudiu
So there is no way to pass by ajax? Any workaround? To pass by get?
esafwan
Get is still an ajax method. Why would you necessarilly need Ajax anyway? If you really want an alternative, I think you can open a pop-up with the params in the URL and make that self.close() after the request is sent...
Claudiu
So how will that be? I know how to open a popup and I know how to submit a form. But how do you submit a form through popup?
esafwan
Did u mean something like var value = $(.name).val(); var url="http://som.com?q=" + value;window.open (url,"mywindow");
esafwan
When you open a popup, you can pass the URL of the window you want to open, right? So you can simply open a pop-up with the address http://example.com/contact.php?name=something you'd have $('.name').val(); (with quotes), that if you already assigned a class 'name' to the field containing the name. Then you can use $_GET in PHP to retrieve variables from the URL, for example.
Claudiu
K great.. thanx for the info....
esafwan
+1  A: 

How about this idea?

Have a Shortcut which will open the contact form hosted in your site in a web browser.Users can then submit their details via the online form.

Shoban