C
css-discuss.org
I have a question about the submit inputs. There are two filtered
submit inputs that are independent of each other.
I want to capture which one the user clicked. I get a syntax error on
the asterisks.
Firebug says "illegal character " at the end of the else if line.
I think it may be because the
onclicks submit buttons are outside the javascript or else the onclick
needs to be a js function?
I tried putting javascript tags around the form but I got the same
exact error.
The global var btnClicked needs to pick up the value of which submit
button was clicked.
Then the clkButton function return value should be passed to the
getConfigURL function.
It looks like it should work and just needs some clarity on the above.
Thanks, JR
<form>-----------------------------
<span id= "searchOrderNumber">
Order Number: <input type="text" id="orderNumber" name="orderNumber"
size="20" value="" />
<input id="filterSearch" type="submit"
value="Search" onclick="btnClicked=this" /></span>
type="hidden" id="xmlEndDate" name="xmlEndDate" /></li>
<li>EmpNo: <input type="text" id="EmpNo" name="EmpNo" size="4"
value="" /></li>
<li><input id="filterSubmit" type="submit" value="Submit"
onclick="btnClicked=this" /></li>
</ul>
</form>----------------------------------
var btnClicked;// global var to see which filter selected, see input
form
function clkButton() {
var submit;
if(btnClicked.value== 'Submit' ) {
submit = 'submitFilter' ;
}else if (btnClicked.value=='Search') { ​ ******stops here before
it gets passed to next function
submit = 'submitSearch' ;
}
return submit;
}
function getConfigURL(submitType,xmlStartDate, xmlEndDate) {
if(submitType=="submitFilter") { //
clickHandler
var plant = YAHOO.util.Dom.get("userPlant").value;
var configURL = sent parameters in url to databasexxxxx
.........................
}else if(submitType=="submitSearch"){ //
clickHandler2
var configURL = sent parameters in url to
databasexxxxxxxx
var orderNumber = YAHOO.util.Dom.get("orderNumber").value;
}
....................................
submit inputs that are independent of each other.
I want to capture which one the user clicked. I get a syntax error on
the asterisks.
Firebug says "illegal character " at the end of the else if line.
I think it may be because the
onclicks submit buttons are outside the javascript or else the onclick
needs to be a js function?
I tried putting javascript tags around the form but I got the same
exact error.
The global var btnClicked needs to pick up the value of which submit
button was clicked.
Then the clkButton function return value should be passed to the
getConfigURL function.
It looks like it should work and just needs some clarity on the above.
Thanks, JR
<form>-----------------------------
<span id= "searchOrderNumber">
Order Number: <input type="text" id="orderNumber" name="orderNumber"
size="20" value="" />
<input id="filterSearch" type="submit"
value="Search" onclick="btnClicked=this" /></span>
<li>End Date: <input type="text" id="endDate" name="endDate" /><input<input type="hidden" id="xmlStartDate" name="xmlStartDate" /></li>
type="hidden" id="xmlEndDate" name="xmlEndDate" /></li>
<li>EmpNo: <input type="text" id="EmpNo" name="EmpNo" size="4"
value="" /></li>
<li><input id="filterSubmit" type="submit" value="Submit"
onclick="btnClicked=this" /></li>
</ul>
</form>----------------------------------
var btnClicked;// global var to see which filter selected, see input
form
function clkButton() {
var submit;
if(btnClicked.value== 'Submit' ) {
submit = 'submitFilter' ;
}else if (btnClicked.value=='Search') { ​ ******stops here before
it gets passed to next function
submit = 'submitSearch' ;
}
return submit;
}
function getConfigURL(submitType,xmlStartDate, xmlEndDate) {
if(submitType=="submitFilter") { //
clickHandler
var plant = YAHOO.util.Dom.get("userPlant").value;
var configURL = sent parameters in url to databasexxxxx
.........................
}else if(submitType=="submitSearch"){ //
clickHandler2
var configURL = sent parameters in url to
databasexxxxxxxx
var orderNumber = YAHOO.util.Dom.get("orderNumber").value;
}
....................................