Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script abends w/o error!?

Status
Not open for further replies.

jl8789

MIS
May 22, 2003
293
US
What is wrong here? I am calling this function within a .cfm page, here are my controls and save button:
<td align="left"><input type="text" id="TAG" name="tag" value="#podFieldsGet.PFD_TAG_TXT#" onblur="return convertToUpper(this);" maxlength="16" size="16"></input>
-&nbsp;&nbsp;<input type="text" id="TITLE" name="title" value="#podFieldsGet.PFD_TITLE_TXT#" maxlength="64" size="64"></input></td>
</tr>
<tr><td colspan="2">
<input type="button" name="Save" value="Save" onclick="doSubmitFor2('save',document.editTitleForm,document.editTitleForm.tag,document.editTitleForm.text);">

Here is the script.
function doSubmitFor2(act,doc,cntrl,cntrl2){
alert("HEllo!");
if (act == 'delete'){
if (confirm("Are you sure you want to delete?")){
doc.action.value = 'Delete';
doc.submit();
}
}
else{
alert("we are in else!");
if(cntrl){
alert("we are in cntrl!");
var objValue = new String(cntrl.value);
var obj2Value = new String(cntrl2.value);
alert("objvalue is " +objValue);
alert("obj2Value is " +obj2Value);

The messages show up to the "we are in cntrl!" message, and then stops, nothing happens after that! Is there something wrong with how I am assigning the variables!?!?!?

Thank You!
 
get rid or your string declarations.

just do:

Code:
var objValue = cntrl.value;
var obj2Value = cntrl2.value;

also, avoid naming elements "text", "name", "submit", "action" and any other javascript reserved keyword. it'll only get you into trouble.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Ah yah. I see now, I was passing .text into the script instead of .title... idiot.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top