dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: dynamically data update in client side

  1. #1
    Join Date
    Feb 2014
    Posts
    1

    dynamically data update in client side

    hai to everybody,
    I am new to java script i have a problem regarding to dynamically created check boxes. I have no orders in my catalog there rare two dynamically created deliver and undelivered check boxes for each order if any one select check boxes and click deliver button they are sent to database there status updated
    and in the front end that orders check boxes only hide the deliver check boxes and only display the undelivered check boxes without page reload how can I achieve that please help me. how can I pick that check boxes.I am sending order ids to the database to update deliver status in database...
    Thanks in advance

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,136
    is it possible to re-word and elaborate a bit more on your question?
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  3. #3
    Join Date
    Feb 2014
    Location
    Canada
    Posts
    155
    If I understand your question, you want to create checkboxes in pairs of "deliver" and "undelivered" for each item to be displayed. When the user clicks on, say, deliver, then it is hidden from view. If that's what you want, then try out the following.

    HTML Code:
    <!DOCTYPE html>
    <html>
    	<head>
    		<script type = "text/javascript">
    			function showOrHide(x) {
    				 <!-- x.parentNode.style.display = "none"; hides it but doesn't seem like a great idea to me -->
    				 x.parentNode.style.color = "blue"; <!-- seems better -->
    			}
    		</script>
    	</head>
    	<body>
    		<form action = "somepage.php" method = "post">
    			<label for = "box1">Deliver item 1
    			<input type = "checkbox" id = "box1" name = "box1" value = "deliverbox1" onClick = "showOrHide(this)" /></label>
    			<br />
    			<label for = "box1Un">Undelivered item 1
    			<input type = "checkbox" id = "box1un" name = "box1" value = "undeliveredbox1" onClick = "showOrHide(this)" /></label>
    			<br />
    			<input type = "submit" value = "OK" />
    		</form>
    	</body>
    </html>
    Tossing in my 2 cents, it doesn't seem like a great idea to hide the checkbox when the user clicks it in case they want to change their option, click on the wrong thing, and so forth, is to have them reload the page or use AJAX. It would be better to

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles