0
document.getElementById('f_widget_job_search').action =("http://api.simplyhired.com/a/jobs-api/xml-v2/q-"+q+"&l"+l+"?"+"pshid=55414&ssty=2"+"&cflg=r&jbd=doors.jobamatic.com&clip=38.98.177.132");

I am trying to get this url that is based on a few form values that are pulled in via variables to be the action of a form, with no luck... it seems that I am having trouble with #1 the variable based portion of the url monster being included twice like this:

http://api.simplyhired.com/a/jobs-api/xml-v2/q-Billing&l-?l=&q=Billing

or

if i remove the question mark from the url i get:

http://api.simplyhired.com/a/jobs-api/xml-v2/q-Select%20all%20that%20apply...&l-pshid=55414&ssty=2&cflg=r&jbd=doors.jobamatic.com&clip=38.98.177.132?l=&q=Select+all+that+apply...

see how that last bit just keeps getting repeated?

I am fairly new to javascript and I know that the ? is the thing that is screwing me up, but I need it in the url to make it work, so i guess what i need to know is how to write this in such a way as to include the question mark and not have it screw up the way the url is being output.

Thank you so much in advance, I have been trying to figure this out for hours.

edit

function earl() {
var q=document.f_widget_job_search.q.value;
var l=document.f_widget_job_search.l.value;

document.getElementById('f_widget_job_search').action;
document.getElementById('f_widget_job_search').action = ("http://api.simplyhired.com/a/jobs-api/xml-v2/q-"+q+"&l-"+l+"\?pshid=55414&ssty=2"+"&cflg=r"+"&jbd=doors.jobamatic.com"+"&clip=38.98.177.132");
}

<form id="f_widget_job_search" name="f_widget_job_search" class="search_form" onSubmit="javascript:earl()">
   <select id="q" name="q">
      <option>1</option>
      <option>2</option>
      <option>3</option>
      <option>4</option>
   </select>
   <input id="l" name="l" type="text">
4
  • Check this out: stackoverflow.com/questions/12567953/… Commented Oct 24, 2013 at 20:49
  • @kol , I am not having a problem with the url being output, it's being put together correctly, except the question mark is making weird things happen as far as i can tell. Commented Oct 24, 2013 at 21:07
  • Can you post the javascript that pulls the form values? Commented Oct 25, 2013 at 0:21
  • I will @kehrk i will edit my post Commented Oct 25, 2013 at 15:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.