sudjo
04-28-2008, 05:12 AM
Hi all,
I have a simple problem, but I can't seem to figure this out for the life of me.
Problem:
1. Using Javascript and PHP
2. Move values from onClick links to text boxes
3. Want to call the function (superpaste) to create a custom sql statement. Every thing works other than the calling of the superpaste function and its workings.
http://utite.org/resumeinfo/easysql.php#
function superpaste(){
var writingblock = document.myQueryForm.query;
var degree = document.first_form.degree.value;
var interest = document.first_form.interest.value;
var region = document.first_form.region.value;
var experience = document.first_form.experience.value;
var writingblock.value = "Select * from Resume WHERE degree_program = '";
var writingblock.value =+ degree;
var writingblock.value =+ "' AND interest = '";
var writingblock.value =+ interest;
var writingblock.value =+ "' AND region ='";
var writingblock.value =+ region;
var writingblock.value =+ " ' AND experience = '";
var writingblock.value =+ experience;
var writingblock.value =+ "' ;";
}
}
//////////////////////////////////////////////////////////////////////////////////
/*
This function tests to see if something has been entered in the query.
If empty then an alert box appears and the form submission is halted
*/
function isQuery() {
var myForm = document.myQueryForm;
if ( myForm.query.value == 0 ) {
alert("There is no query.\nPlease enter a query.");
myForm.query.focus();
return false;
}
return true;
}
// -->
</script>
<!-- END OF JAVASCRIPT FUNCTIONS FOR ALL easysql.php RELEASES -->
<META name="ROBOTS" content="NOINDEX,NOFOLLOW">
<style type="text/css">
<!--
.style1 {
color: #CC5500;
font-weight: bold;
}
-->
</style>
</HEAD>
<BODY>
<td align="left"><p class="style1">Candidate Profile Builder:</p>
<p><strong>Degree:</strong>
<a href="#" onClick="document.first_form.degree.value='Undergraduate';">Undergraduate[/url]
<a href="#" onClick="document.first_form.degree.value='MBA';">MBA[/url]
<a href="#" onClick="document.first_form.degree.value='PhD';">Ph D[/url]
<p><strong>Looking For:</strong>
<a href="#" onClick="document.first_form.interest.value='Internship';">Internship[/url]
<a href="#" onClick="document.first_form.interest.value='Part Time';">Part Time[/url]
<a href="#" onClick="document.first_form.interest.value='Full Time';">Full Time[/url]
</p>
<p><strong>Where</strong>:
<a href="#" onClick="document.first_form.region.value='Texas';">Texas and Surrounding Area[/url]
<a href="#" onClick="document.first_form.region.value='North';">North[/url]
<a href="#" onClick="document.first_form.region.value='South';">South[/url]
<a href="#" onClick="document.first_form.region.value='West';">West[/url]
<a href="#" onClick="document.first_form.experience.value='East';">East[/url]
<p><strong>Relevant Work Experience:</strong>
<a href="#" onClick="document.first_form.region.value='<=1';">1 or Less[/url]
<a href="#" onClick="document.first_form.experience.value='<=2 AND >= 1';">1-2 Years[/url]
<a href="#" onClick="document.first_form.experience.value='>=2';">2+ Years[/url]
<a href="#" onClick="superpaste()">YES[/url]
<p><strong>My Candidate:
</strong>
<form name="first_form">
<input name="degree" type="text" id="degree">
<input name="interest" type="text" id="interest">
<input name="region" type="text" id="region">
<input name="experience" type="text" id="experience">
</form>
I have a simple problem, but I can't seem to figure this out for the life of me.
Problem:
1. Using Javascript and PHP
2. Move values from onClick links to text boxes
3. Want to call the function (superpaste) to create a custom sql statement. Every thing works other than the calling of the superpaste function and its workings.
http://utite.org/resumeinfo/easysql.php#
function superpaste(){
var writingblock = document.myQueryForm.query;
var degree = document.first_form.degree.value;
var interest = document.first_form.interest.value;
var region = document.first_form.region.value;
var experience = document.first_form.experience.value;
var writingblock.value = "Select * from Resume WHERE degree_program = '";
var writingblock.value =+ degree;
var writingblock.value =+ "' AND interest = '";
var writingblock.value =+ interest;
var writingblock.value =+ "' AND region ='";
var writingblock.value =+ region;
var writingblock.value =+ " ' AND experience = '";
var writingblock.value =+ experience;
var writingblock.value =+ "' ;";
}
}
//////////////////////////////////////////////////////////////////////////////////
/*
This function tests to see if something has been entered in the query.
If empty then an alert box appears and the form submission is halted
*/
function isQuery() {
var myForm = document.myQueryForm;
if ( myForm.query.value == 0 ) {
alert("There is no query.\nPlease enter a query.");
myForm.query.focus();
return false;
}
return true;
}
// -->
</script>
<!-- END OF JAVASCRIPT FUNCTIONS FOR ALL easysql.php RELEASES -->
<META name="ROBOTS" content="NOINDEX,NOFOLLOW">
<style type="text/css">
<!--
.style1 {
color: #CC5500;
font-weight: bold;
}
-->
</style>
</HEAD>
<BODY>
<td align="left"><p class="style1">Candidate Profile Builder:</p>
<p><strong>Degree:</strong>
<a href="#" onClick="document.first_form.degree.value='Undergraduate';">Undergraduate[/url]
<a href="#" onClick="document.first_form.degree.value='MBA';">MBA[/url]
<a href="#" onClick="document.first_form.degree.value='PhD';">Ph D[/url]
<p><strong>Looking For:</strong>
<a href="#" onClick="document.first_form.interest.value='Internship';">Internship[/url]
<a href="#" onClick="document.first_form.interest.value='Part Time';">Part Time[/url]
<a href="#" onClick="document.first_form.interest.value='Full Time';">Full Time[/url]
</p>
<p><strong>Where</strong>:
<a href="#" onClick="document.first_form.region.value='Texas';">Texas and Surrounding Area[/url]
<a href="#" onClick="document.first_form.region.value='North';">North[/url]
<a href="#" onClick="document.first_form.region.value='South';">South[/url]
<a href="#" onClick="document.first_form.region.value='West';">West[/url]
<a href="#" onClick="document.first_form.experience.value='East';">East[/url]
<p><strong>Relevant Work Experience:</strong>
<a href="#" onClick="document.first_form.region.value='<=1';">1 or Less[/url]
<a href="#" onClick="document.first_form.experience.value='<=2 AND >= 1';">1-2 Years[/url]
<a href="#" onClick="document.first_form.experience.value='>=2';">2+ Years[/url]
<a href="#" onClick="superpaste()">YES[/url]
<p><strong>My Candidate:
</strong>
<form name="first_form">
<input name="degree" type="text" id="degree">
<input name="interest" type="text" id="interest">
<input name="region" type="text" id="region">
<input name="experience" type="text" id="experience">
</form>