Jump to content

needing some advice on submitting


dmcg

Recommended Posts

i'm trying to build a cms.  I'm needing some advice on submitting.

 

have two senerios

1. embedded self referencing URL s

2. menu editor update

 

1.  embeded self refrencing URLs within the content its self such as

<a href="index.php?content=generic&action=viewlist&category=4" >category four, listing</a><br>
<a href="index.php?content=generic&action=view&item=43" >some other content</a> 

 

2.  Menu editor updating

when i set the url of the menu item to

'index.php?content=generic&action=viewlist&category=4'

then when i go to submit it, errors out.  Because the query keys are repeated within the query string.  How can i handle this, with out changing my query keys?

 

 
<form id="adminform" action="index.php" method="post" >		 
<input type="hidden" id="itemid" value="{contentid}" />
<table style="text-align: left; width: 65%;" border="01" cellpadding="2" cellspacing="2">
	<tbody>   
		<tr>
			<td style="vertical-align: top;text-align: right;">Section :</td>
			<td style="vertical-align: top;">{sectionid}</td>
		</tr> 
		<tr>
			<td style="vertical-align: top;text-align: right;">Category :</td>
			<td style="vertical-align: top;">{categoryid}</td>
		</tr> 
		<tr>
			<td style="vertical-align: top;text-align: right;">Title:</td>
			<td style="vertical-align: top;">{title}</td>
		</tr>   
		<tr>
			<td style="vertical-align: top;text-align: right;">body:</td>
			<td style="vertical-align: top;">{body}</td>
		</tr>
	</tbody>
</table>
</form>   
<script language="JavaScript"> 
function submitbutton(pressedbutton) {
/*var form = document.editform;*/
if (pressedbutton == 'cancel') { 
	window.location = 'index.php?content=frontpage&action=view';
	return;
}    
s = 'index.php?content=genericcontent&action=' + pressedbutton
	+ '&itemid=' + document.getElementById('itemid').value 
	+ '&sectionid=' + document.getElementById('sectionid').value
	+ '&categoryid=' + document.getElementById('categoryid').value
	+ '&title=' + document.getElementById('title').value  
	+ '&body=' + document.getElementById('body').value; 

window.location = s; 

}   
</script>

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.