Results 1 to 9 of 9
- 01-19-2012, 05:42 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 6
- Rep Power
- 0
- 01-19-2012, 05:56 AM #2
Re: Adding auto complete field in form
I would think you could use a keyboard listener and once all three fields have content, then add two more to the JPanel.
- 01-19-2012, 06:04 AM #3
Member
- Join Date
- Jan 2012
- Posts
- 6
- Rep Power
- 0
Re: Adding auto complete field in form
Thanks for the reply. Is there any code example which is available for me to analyse?
- 01-19-2012, 06:07 AM #4
Re: Adding auto complete field in form
Depends on where you are stuck. Do you know how to use a KeyListener?
- 01-19-2012, 06:34 AM #5
Member
- Join Date
- Jan 2012
- Posts
- 6
- Rep Power
- 0
Re: Adding auto complete field in form
I was just seeing a demo on oracle site. But honestly im new to java. im not stuck yet. I am yet to start. What i have described is the problem statement that i have.
- 01-19-2012, 06:44 AM #6
Re: Adding auto complete field in form
You didn't answer my question.
- 01-19-2012, 07:03 AM #7
Member
- Join Date
- Jan 2012
- Posts
- 6
- Rep Power
- 0
Re: Adding auto complete field in form
@quad64bit I really do not know how to use keylistener
- 01-19-2012, 07:06 AM #8
Member
- Join Date
- Jan 2012
- Posts
- 6
- Rep Power
- 0
Re: Adding auto complete field in form
This is some code that i have found
<html>
<head>
<title></title>
<script language="javascript">
fields = 0;
function addInput() {
if (fields != 10) {
document.getElementById('text').innerHTML += "<input type='input' value='' name='field[]' /><br />";
fields += 1;
} else {
document.getElementById('text').innerHTML += "<br />Only 10 upload fields allowed.";
document.form.add.disabled=true;
}
}
</script>
</head>
<body>
<form name="form" action="form.php" method="post">
<input type="button" onclick="addInput()" name="add" value="Add input field" />
<div id="text">
</div>
<br />
<input type="submit" value="Submit" />
</form>
</body>
</html>
issues with this is user has to manually click on add input field. I want this to be dynamic. I also want to add three fields at a time.
- 01-19-2012, 07:14 AM #9
Member
- Join Date
- Jan 2012
- Posts
- 6
- Rep Power
- 0
Re: Adding auto complete field in form
Now i have three fields. I just want to make it dynamic.
<html>
<head>
<title></title>
<script language="javascript">
fields = 0;
function addInput() {
if (fields != 10) {
document.getElementById('text').innerHTML += "<input type='input' value='' name='field[]' /><br />" ;
document.getElementById('text').innerHTML += "<input type='input' value='' name='field[]' /><br />" ;
document.getElementById('text').innerHTML += "<input type='input' value='' name='field[]' /><br />" ;
fields += 1;
} else {
document.getElementById('text').innerHTML += "<br />Only 10 upload fields allowed.";
document.form.add.disabled=true;
}
}
</script>
</head>
<body>
<form name="form" action="form.php" method="post">
<input type="button" onclick="addInput()" name="add" value="Add input field" />
<div id="text">
</div>
<br />
<input type="submit" value="Submit" />
</form>
</body>
</html>
as in i do not need click button
Similar Threads
-
looking for a form pane or form group panel for the jpanel to complete tutorial
By nadeemshafi9 in forum AWT / SwingReplies: 1Last Post: 03-22-2010, 09:03 AM -
Auto Complete - Please Assit
By chellede in forum New To JavaReplies: 1Last Post: 01-29-2010, 07:02 PM -
auto complete textarea
By praba@spiretek.in in forum AWT / SwingReplies: 0Last Post: 11-16-2009, 07:06 AM -
Auto-complete/Auto-fix for custom statement
By dark_cybernetics in forum EclipseReplies: 0Last Post: 08-19-2008, 11:19 AM -
[SOLVED] Auto complete Text.
By smartsubroto in forum New To JavaReplies: 9Last Post: 06-27-2008, 04:05 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks