JoennAquilino Posted April 4, 2016 Report Share Posted April 4, 2016 Hi! I'm trying to figure out what's wrong this code(http://forums.caspio.com/index.php/topic/3200-js-concatenatecombine-two-fields-into-one-field/) when editing data. I'm not going anywhere. Is there another way to edit a concatenated table field? Or maybe, is there a way to combine two fields and edit certain table field when submitted? Thank you. EDIT Oh, I made it work. Thanks. Quote Link to comment Share on other sites More sharing options...
MayMusic Posted April 6, 2016 Report Share Posted April 6, 2016 So in the edit page you need to add the same code with the changes mentioned <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var position1 = document.getElementById("EditRecordPosition1").value; var position2 = document.getElementById("EditRecordPosition2").value; var allpositions = position1 + position2; document.getElementById("EditRecordAllPositions").value = allpositions; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> Quote Link to comment Share on other sites More sharing options...
JoennAquilino Posted April 8, 2016 Author Report Share Posted April 8, 2016 I've tried that one actually but still didn't work. I tried this one... <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var field1= document.getElementById("EditRecordField1").value; var field2= document.getElementById("EditRecordField2").value; var allfield= field1+field2; document.getElementById("EditRecordAllField").value = allfield; } var v_btn = document.getElementById("Mod0EditRecord"); if(v_btn.addEventListener){ v_btn.addEventListener('mouseover', concatenate); }else if(v_btn.attachEvent){ v_btn.attachEvent('onmouseover', concatenate); }else{ var prevEvt = v_btn.onmouseover v_btn.onmouseover= function(){ concatenate(); prevEvt && prevEvt(); }; } </SCRIPT> Quote Link to comment Share on other sites More sharing options...
NiteshDani Posted April 10, 2016 Report Share Posted April 10, 2016 Is there any Built in function to concatenate two field / build a composite key or Java Script is the only Solution. Quote Link to comment Share on other sites More sharing options...
JoennAquilino Posted April 13, 2016 Author Report Share Posted April 13, 2016 Is there any Built in function to concatenate two field / build a composite key or Java Script is the only Solution. As far as I know, there is none. Only javascript. You might want to read this thread: http://forums.caspio.com/index.php/topic/3200-js-concatenatecombine-two-fields-into-one-field/ It's easy to follow. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.