jaggernat
asked on
javascript add,edit remove in jsp page
hi experts,
I have some problem with javascript in my jsp page
I have three fields
<span class="formleft">LRN# <input type="text" name="lrnNo" size="20" value='<%= field1[i]%>' class="formstyle"> </span>
<span class="formleft">Lab Test <input name="labTestDesc" type="text" class="formstyle" value='<%= field2[i]%>' size="20"> </span>
<span class="formleft">Lab Result <input name="labResultDesc" type="text" class="formstyle" value='<%= field3[i]%>' size="20"> </span>
the above three fields are getting values FROM DATABASE and getting displayed in one row. Now , i have three buttons under these three fields
<input name="Submit1" type="button" class="formbutton" value="Add " onclick="addLRN();">
<input name="Submit2" type="button" class="formbutton" value="Edit " onclick="editLRN();">
<input name="Submit3" type="button" class="formbutton" value="Remove" onclick="removeLRN();">
my requirment:
the three buttons should add(new row with three blank fields) , edit(current row fields) and delete(current row fields) respectively.
any idea how i can add a blank row with the above three fields ? any logic for edit and remove would be greatly appreciated.
thanks
J
I have some problem with javascript in my jsp page
I have three fields
<span class="formleft">LRN# <input type="text" name="lrnNo" size="20" value='<%= field1[i]%>' class="formstyle"> </span>
<span class="formleft">Lab Test <input name="labTestDesc" type="text" class="formstyle" value='<%= field2[i]%>' size="20"> </span>
<span class="formleft">Lab Result <input name="labResultDesc" type="text" class="formstyle" value='<%= field3[i]%>' size="20"> </span>
the above three fields are getting values FROM DATABASE and getting displayed in one row. Now , i have three buttons under these three fields
<input name="Submit1" type="button" class="formbutton" value="Add " onclick="addLRN();">
<input name="Submit2" type="button" class="formbutton" value="Edit " onclick="editLRN();">
<input name="Submit3" type="button" class="formbutton" value="Remove" onclick="removeLRN();">
my requirment:
the three buttons should add(new row with three blank fields) , edit(current row fields) and delete(current row fields) respectively.
any idea how i can add a blank row with the above three fields ? any logic for edit and remove would be greatly appreciated.
thanks
J
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for the code dude. it helped me a lot. Can you please help me out with other javascript questions i posted (html:radio validation ) and javascript calendar.
Regards
j
Regards
j
What html tag(s) appear after the Lab Result line?
<span class="formleft"></span>
Or something else? Are you limited by other existing html constructs around this, or are these the only requirements?
Do you have any existing code for the required functions?
function addLRN() {
...
}
function editLRN() {
...
}
function removeLRN() {
...
}
Posting these would help the experts.
Peace and joy. mvan