dcsimg
js text input population problems
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   gian_Vimercati
Posted On:   Wednesday, September 10, 2003 12:43 AM

hello, quick question... i'm using javascript to populate two text boxes within a form... post code and town code(dependant on a drop down box selection)... this all works fine and populates the input boxes without problems only that when i submit the form... the values dont get passed to the next page. Is there a way around this that anyone can help me with? the code i use is below... function changecomres(value, flag) { if (flag =='Nas') { window.open('/xxxxx/detcom.php?tipo=1&pro='+value, //other window settings); } else { window.open('/xxxxx/detcom.php?tipo=2&pro='+value, //ot   More>>
hello,




quick question... i'm using javascript to populate two text boxes within a form... post code and town code(dependant on a drop down box selection)... this all works fine and populates the input boxes without problems only that when i submit the form... the values dont get passed to the next page. Is there a way around this that anyone can help me with?


the code i use is below...





function changecomres(value, flag)


{


if (flag =='Nas') {


window.open('/xxxxx/detcom.php?tipo=1&pro='+value, //other window settings);


}


else {


window.open('/xxxxx/detcom.php?tipo=2&pro='+value, //other window settings);


}


}





//the following select is part of the main form that has truble passing the values








$comuniStr = "SELECT * FROM table WHERE Province='".$pro."'";


echo "






.


.





********end detcom.php********





ps. the detcom file works without a problem... the input text fields get populated without a problem... i simply dont see the values once i post the form in the main file...





pps. 1 thing to note is the inputs that are populated by detcom are disabled... by i dont see that that would be an issue...





Hope this makes sence... if you need more info, let me know... thanks heaps...





gianni    <<Less

Re: js text input population problems

Posted By:   Joost_Schouten  
Posted On:   Wednesday, September 10, 2003 02:16 AM

IE does not sent diabled fields. Enable them and all should work fine. (I don't know how other browsers handle them, but since it is not standard javascript you should be certain about which browsers your users use)


A little trick like onClick="yourElementClickedOn.blur();" will also prevent your users from edeting it. A more elegant solution if you ask me is to work with hidden fields and a possible dynamic javascript change of the textual representation of the values stored in the hidden fields.


Good luck,


Joost

About | Sitemap | Contact