Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Input field substitution

Posted on 2003-12-03
4
Medium Priority
?
214 Views
Last Modified: 2010-04-06
Hi:

One of these days I got here this code below, which is working perfectly. But I realized that, when it adds the host "srv" to the entered domain name, it always show the complete server address in the Input Field. Is there a way of hiddening what it does? Thanks.

Mario./

Code:

<form>    
<input name="SERVER">
<input type=button value=Replace onClick="this.form.SERVER.value=this.form.SERVER.value.replace(/^(mail.|www.|srv.)*(\w+\.\w+)/i,'srv.$2')">
</form>
0
Comment
Question by:multisites
  • 3
4 Comments
 
LVL 4

Expert Comment

by:mikosha
ID: 9866925
Yuo can add one more hidden field to store updated value and js function for onClick event that will take thevalue from SERVER input ,update it , and stor ein this new hidden field.

cheers:)
0
 

Author Comment

by:multisites
ID: 9868535
Could you give me an example using this code I mentioned? Thanks a lot.
0
 
LVL 4

Accepted Solution

by:
mikosha earned 500 total points
ID: 9868572
Somthing like this, I think:

<form>    
<input name="SERVER">
<input name="SERVER_UPD" type='hidden'>
<input type=button value=Replace onClick="mybutton_click(this.form)">
</form>
<script language='javascript'>
function mybutton_click(current_form){
   current_form .SERVER_UPD.value = this.form.SERVER.value.replace(/^(mail.|www.|srv.)*(\w+\.\w+)/i,'srv.$2');
   return true
}
</script>
0
 
LVL 4

Expert Comment

by:mikosha
ID: 9883662
Thanx:)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question