0

Possible Duplicate:
Ways to circumvent the same-origin policy

i have this situation:

i have a form to be filled in my website, and in that form there is an input for a number that i have to check to see if it's a valid number or not.to check that this number is valid, there is another website and there is an input in that site which you can enter the number and if it is valid(it's registered in something) then it will show you the name of the person related to that number. how can i do this...i wanna have a onBlur() function on the input in my website which do the trick for me, and if it's not valid alert it. can you help?

btw, it's the website which checks if the number is valid: http://portal.irimc.org/DoctorSearchEngine/Search.aspx

you enter a number(e.g. 12554) in the top input and it shows that it belongs to somebody and it's valid.

thanks.

Community
  • 1
  • 1
Shanty
  • 3
  • 1
  • 4
  • 1
    You want a form on your website to input data into a form on another website and get a response? It isn't possible unless the other website is written to accommodate that purpose. – Kevin B Jul 20 '12 at 17:36
  • you can do this from your server when your form is submitted. if you want to do it from the client code then please see the earlier comments. – akonsu Jul 20 '12 at 17:50
  • to **@KevinB**-->almost yes,i want a value that user inputs in my website to be entered in a form in that other website and give me the result.it was nice if i had some kind of abilities like Robot class in Java.and yes that another website is not written to accommodate my purpose,and that's the problem... – Shanty Jul 21 '12 at 00:00

1 Answers1

0

It's impossible with client side javascript but possible with backend server support. From your website you get data from user and send with AJAX to your server, server load form from another website, fill it and get/parse response. Then return response for your Ajax request.

Read about sending POST/GET request's from server site.

Examples:

See how easy is filling form with capybara:

def login!
    within("//form[@id='session']") do
      fill_in 'Login', :with => 'user@example.com'
      fill_in 'Password', :with => 'password'
    end
    click_link 'Sign in'
end
Community
  • 1
  • 1
rogal111
  • 5,874
  • 2
  • 27
  • 33