Does anyone know how to combine form fields? I have 3 separate fields for a phone number (areacode, prefix, and number). I'd like to pass a single, formatted field to the CGI script [(areacode) prefix-number]. Is that possible?
Thanks.
Does anyone know how to combine form fields? I have 3 separate fields for a phone number (areacode, prefix, and number). I'd like to pass a single, formatted field to the CGI script [(areacode) prefix-number]. Is that possible?
Thanks.
Not reliably so, no. Why would you want to do such a thing?
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Because, as I said, I've separated the phone number into three input fields but I only want a single formated field sent to the CGI script.
Ah - you have no control over the CGI script, I take it.
Well, try:... where "phone" is a hidden input element.Code:<form onsubmit=" var a = elements['area'], p = elements['prefix'], n = elements['number']; elements['phone'].value = a + " " + p + "-" + n; return true; ">
However, as I said, this is very unreliable; if you can possibly alter the CGI script to take the three seperate fields, I strongly suggest you do so.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Twey.
Thanks, I'll try it. No, I don't have any control over the CGI. Based on what you said about its reliability though, I may end up just making it a single Phonenumber field and let the submitter enter the number however they want. Not as neat, but a lot easier to implement.
Thanks again.
True. Neatness counts for something, but efficiency and user-control is nicer, in my opinion.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks