473,324 Members | 2,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

fields merging prior to form submitting

Hi group
I have a form with fields for NAME and SURNAME. I need them in
different fields, but I also need to submit them as a unique field
"COMPLETENAME". Is there any way to "capture" them when the user clicks
on the submit button, and merge then, and put the value in a hidden
field "COMPLETENAME" and then finally submit the form?

Thanks a lot in advance.
-
Nacho

Jun 18 '06 #1
7 1492
-Nacho- wrote:
Hi group
I have a form with fields for NAME and SURNAME. I need them in
different fields, but I also need to submit them as a unique field
"COMPLETENAME". Is there any way to "capture" them when the user clicks
on the submit button, and merge then, and put the value in a hidden
field "COMPLETENAME" and then finally submit the form?


Yes. Yes there is, and it's extremely easy if you read any kind of Javascript tutorial, manual or guide.
Jun 18 '06 #2

-Nacho- wrote:
Hi group
I have a form with fields for NAME and SURNAME. I need them in
different fields, but I also need to submit them as a unique field
"COMPLETENAME". Is there any way to "capture" them when the user clicks
on the submit button, and merge then, and put the value in a hidden
field "COMPLETENAME" and then finally submit the form?


And if the user has JavaScript disabled or turned off? Whatever you do
at the client must be done also at the server, you can't depend on it
happening at the client.

For what it's worth:

<form action=""
onsubmit="
this.completename.value =
this.firstname.value+this.surname.value;
// Just for debug...
alert(this.completename.value);
">
first name: <input type="text" name="firstname"><br>
surname: <input type="text" name="surname"><br>
<input type="hidden" name="completename">
<input type="submit">
</form>

Jun 18 '06 #3
RobG said the following on 6/18/2006 7:43 PM:
-Nacho- wrote:
Hi group
I have a form with fields for NAME and SURNAME. I need them in
different fields, but I also need to submit them as a unique field
"COMPLETENAME". Is there any way to "capture" them when the user clicks
on the submit button, and merge then, and put the value in a hidden
field "COMPLETENAME" and then finally submit the form?


And if the user has JavaScript disabled or turned off?


Then 98% or so of the web is useless to them.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 19 '06 #4
Randy Webb wrote:
RobG said the following on 6/18/2006 7:43 PM:

<snip>
And if the user has JavaScript disabled or turned off?


Then 98% or so of the web is useless to them.


Then the remaining 2% get all of their business.

Richard.
Jun 19 '06 #5
Richard Cornford said the following on 6/18/2006 9:17 PM:
Randy Webb wrote:
RobG said the following on 6/18/2006 7:43 PM:

<snip>
And if the user has JavaScript disabled or turned off?

Then 98% or so of the web is useless to them.


Then the remaining 2% get all of their business.


Providing they can find the 2% that works for them.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 19 '06 #6

Randy Webb wrote:
Richard Cornford said the following on 6/18/2006 9:17 PM:
Randy Webb wrote:
RobG said the following on 6/18/2006 7:43 PM:

<snip>
And if the user has JavaScript disabled or turned off?
Then 98% or so of the web is useless to them.


Then the remaining 2% get all of their business.


Providing they can find the 2% that works for them.


I think you'll find that about 98% of the internet and 90% of the web
works just fine with scripting disabled.

I was more interested in highlighting to the OP that script was being
used on the client for something that really should be done on the
server. Lack of client script support is the most obvious reason, poor
application design is another, poorly specified requirements is a third
(what to do with surnames that have spaces, hyphens or apostrophes).
--
Rob

Jun 19 '06 #7
RobG said the following on 6/18/2006 10:55 PM:
Randy Webb wrote:
Richard Cornford said the following on 6/18/2006 9:17 PM:
Randy Webb wrote:
RobG said the following on 6/18/2006 7:43 PM:
<snip>
> And if the user has JavaScript disabled or turned off?
Then 98% or so of the web is useless to them.
Then the remaining 2% get all of their business.

Providing they can find the 2% that works for them.


I think you'll find that about 98% of the internet and 90% of the web
works just fine with scripting disabled.


That is not my experience. It only takes trying to log into my Banks
site, my ISP's site or just about any other site and you soon find out
that JS is required on most of them.

The trend on the web, whether it is for better or worse, is towards a
dependency on JS, not away from it. It only takes a thought or two about
the technology referred to as "Web 2.0" to realize it.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 19 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Alexandre | last post by:
Hi again, What's the best I can do to validate fields like date before send my datas. thx
1
by: Melissa | last post by:
I have a web form that has required field validators, and then submits an email when the form is completely filled out. Well, it is working on my local machine, but when I put it out on the server,...
2
by: Klatuu | last post by:
Whew, I've struggled my way through figuring out how to use XML to transport data..now I can imagine what having a baby is like :) But, I'm stuck now. I generate the XML (single table, no...
1
by: svdh | last post by:
I have posed a question last saturday and have advanced alot in the meantime. But I am still not there Problem is that I try to merging various fields from various tables in one document in Word...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.