Jump to content

Passing variable value to external site that uses a javascript "onclick" trigger


phoenixx

Recommended Posts

I'm trying to send a submission to the following Craigslist form that uses javascript to trigger an auto submit.

 

The user selects "For Sale" on my form and it will pass the data in a hidden div to the proper selection on the craigslist page.  Heres the page it would be passing to.  I know I will have to pass it in the URL.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="https://post.craigslist.org">
<title>houston craigslist | choose type</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link type="text/css" rel="stylesheet" media="all" href="/styles/craigslist.css?v=9">
</head>

<body id="pp">
<table width="100%" id="header" summary="header">
<tr valign="top">
  <td><a href="http://houston.craigslist.org/"><b>houston craigslist</b></a> > choose type<br></td>
  <td width="10%" class="highlight" style="text-align: right; white-space: nowrap;">
		<font size="2" face="sans-serif" color="#7a7a7a">[ logged in as <a href="https://accounts.craigslist.org/login"><b>kennymahaffey@gmail.com</b></a>
		] 
		[ <a href="https://accounts.craigslist.org/logout">logout</a> ]</font>
		<br></td>
</tr>
</table>

<hr>
<blockquote>
<div class="highlight">
	<i>Please post to a single geographic area and category only -- cross-posting to multiple cities or categories is not allowed</i>
</div>
<h4>What type of posting is this:</h4>

<form action="https://post.craigslist.org/k/kInfxI4M4RGIA7PWTF5SWg/HjdlJ" method="POST">

<blockquote>
<label>
	<input type="radio" name="id" value="jo" onclick="form.submit(); return false;">job offered 
</label>
    <br>
<label>
	<input type="radio" name="id" value="jw" onclick="form.submit(); return false;">resume / job wanted
</label>
    <br>
    <br>
<label>
	<input type="radio" name="id" value="ho" onclick="form.submit(); return false;">housing offered
</label>
    <br>
<label>
	<input type="radio" name="id" value="hw" onclick="form.submit(); return false;">housing wanted
</label>
    <br>
    <br>
<label>
	<input type="radio" name="id" value="fs" onclick="form.submit(); return false;">for sale
</label>
    <i>(please do not post prohibited <sup><a target="_blank" href="http://www.craigslist.org/about/prohibited.items">[?]</a></sup> or recalled <sup><a target="_blank" href="http://www.craigslist.org/about/recalled_items">[?]</a></sup> items)</i>
    <br>
<label>
	<input type="radio" name="id" value="iw" onclick="form.submit(); return false;">item wanted
</label>
    <br>
    <br>
<label>
	<input type="radio" name="id" value="go" onclick="form.submit(); return false;">gig offered
</label>
    <i>(I'm hiring for a short-term, small or odd job)</i>
    <br>
<label>
	<input type="radio" name="id" value="so" onclick="form.submit(); return false;">service offered
</label>
    <br>
    <br>
<label>
	<input type="radio" name="id" value="p" onclick="form.submit(); return false;">personal / romance
</label>
    <br>
    <br>
<label>
	<input type="radio" name="id" value="c" onclick="form.submit(); return false;">community
</label>
    <br>
<label>
	<input type="radio" name="id" value="e" onclick="form.submit(); return false;">event
</label>
    <br>
    <br>
</blockquote>

<input type="hidden" name="U2FsdGVkX:18yNDg2NDI0O:A8dZroeLa8K5Y677RwK4hzBe2OPdD3XxLUDb5lS9LllELhxNpMqXZIwAWDxJ.7Wo4A" value="U2FsdGVkX18yNDg2NDI0OFjS1qgWn_NKgmgnh5qCZ9aK2m7eOmS-uAAM_Pwu8VHN">
<button type="submit" name="go" value="Continue">Continue</button>
</form>
</blockquote>

Link to comment
Share on other sites

1)  Automated submission and retrieval tools absolutely are a violation of the TOS unless each submission is explicitly typed out by hand.  If that's what your tool does, then there';s no real reason for it to exist.  However, if that's what you want and it conforms to their TOS (each entry is manually typed out by your users every time it's to be submitted) then fine, we can help.

 

2)  There is no javascript on the page you showed aside from the form.submit() in all the onclick attributes.  If that's all you want to emulate, use snoopy or curl to submit the form directly to the action itself.

 

-Dan

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.